The idea for the Sagrada Familia came from a rich Barcelonese publisher called Josep Maria Bocabella, who was worried about the growth of revolutionary ideas in Barcelona. He set up a religious society dedicated to Sant Josep, patron saint of workers and the family, and in 1882 started the building of a church dedicated to the Holy Family (Sagrada Familia). The official name of the church (it is not a cathedral) is Temple Expiatori de la Sagrada Família. The title Temple Expiatori (expiatory temple) indicates that the building of the church is meant to atone for sin and to appeal for God's mercy on Catalunya.

The construction started under Francesc de Villar, who planned a rather conventional neogothic structure. In 1883 Villar was replaced by Antoni Gaudí. Up to 1909 Gaudí worked on other projects beside the Sagrada Familia, but from 1909 on he dedicated himself entirely to the church. As he worked on it, he developed ever grander and more original ideas for it. The ground plan is the basic Gothic cross-shape with an apse. The finished church will have 18 towers: 12 for the apostles, 4 for the evangelists, one for Maria and one for Jesus Christ. There will be three facades: the Nativity facade on the north-east, the Passion facade on the south-west, and the Glory facade on the south-east. The central tower (dedicated to Jesus) will be 170 meters high, halfway between the Nativity and Passion facades, above the crossing.

When Gaudí died in 1926, only the crypt, the apse walls, one portal and one tower had been finished. Since his death the building has continued under other architects (most of them modernistas). By 1930 three more towers had been added, finishing the Nativity facade. In 1936 anarchists burned and smashed everything they could in La Sagrada Família, including the workshops, models and plans. In the 1950's work restarted, using restored models and photographs of drawings.
As of May 2001, the Nativity facade is finished, and the Passion facade almost. The nave (started in 1978) is also almost completed. The new work is done with modern materials (concrete instead of stone for the new towers, for example).