In the late 19th century, rumors circulated about the potential construction of a Protestant church and a hotel-casino on the summit of Tibidabo. In response, a "Board of Catholic Knights" acquired ownership of the land and donated it to Saint John Bosco in 1886 during his visit to Barcelona at the invitation of Dorotea de Chopitea, a prominent supporter of the project. Inspired by the popularity of dedicating buildings to the Sacred Heart of Jesus at the time, the idea emerged to construct a Catholic church on the site, in line with Bosco's own church in Rome (Sacro Cuore di Gesù a Castro Pretorio) and the famous Sacré-Cœur in Paris.
The first structure, a neo-Gothic hermitage, was built in 1886, and a pavilion of Mudejar design was added two years later for the Universal Exposition. However, progress on the church was delayed due to plans for an astronomical observatory on the Tibidabo summit, which was ultimately built on a nearby hill (Fabra Observatory). The foundation stone for the church was laid in 1902, and construction began on the crypt in 1903, with the main church following from 1915 to 1951. The church was consecrated by Bishop Gregorio Modrego Casaus during the 35th Eucharistic Congress held in Barcelona in 1952. The towers were completed later, and the church received the title of minor basilica from Pope John XXIII in 1961.
The church's outer appearance resembles a Romanesque fortress made of stone from Montjuïc, with the crypt below and a grand neo-Gothic church above, accessible via two impressive outdoor stairways. The upper church boasts a central floor with an octagonal dome supported by eight columns. Atop the dome is an image of the Sacred Heart, which was originally created by Frederic Marès but was destroyed in 1936 and later replaced by Josep Miret in 1950.
The upper church is square in shape, featuring three apses, a large central tower, and four smaller towers located at each of the square's corners. Sculpted by Josep Miret, the Twelve Apostles are also visible throughout the structure. The main facade has three sections, with the central section being the widest and featuring the Archangel Michael in the arch of the main entrance and John Bosco in the pediment above. On the left and right sides of the entrance, statues of Teresa of Ávila and Marguerite Marie Alacoque are visible, respectively. Above the entrance, there is an open gallery with arches decorated with tracery.
The crypt facade is adorned with a beautifully crafted tympanum featuring sculptures by Alfons Juyol i Bach based on the design of Eusebi Arnau. The sculptures represent the Virgin of Mercy, Saint George, and Saint James, who are the patron saints of Barcelona, Catalonia, and Spain, respectively. The crypt facade consists of three semicircular arches on columns, inserted under a larger semicircular arch. Originally, the larger arch was decorated with a mosaic of the Holy Trinity by Daniel Zuloaga, but it was destroyed in 1936. In 1955, the Bru Workshop of Barcelona redecorated the arch with an allegory of the devotion of Spain, represented by its patron saints.
Inside the building, there is a central area called the nave, which is flanked by two aisles that lead to semicircular apses. The facades boast four rose windows and stained glass, while the main altar features a remarkable crucifix sculpted by Joan Puigdollers. The presbytery windows depict revered figures such as Pius X, John the Evangelist, Marguerite Marie Alacoque, Paul the Apostle, and John Bosco. The left altar showcases stained glass windows dedicated to a variety of Marian devotions, including the Virgin of Antipolo (Philippines), Our Lady of Luján (Argentina), the Assumption of Mary, Our Lady of Guadalupe (Mexico), and Our Lady of Charity (Cuba). On the right side, there is an altar presided over by a sculpture of the Risen Jesus also created by Joan Puigdollers. This altar's stained glass windows honor Spanish Marian devotions, such as the Virgin of Almudena (Madrid), the Virgin of Núria (Catalonia), Our Lady of Hope, Our Lady of the Forsaken (Valencia), and Our Lady of Begoña (Basque Country).
In addition, the towers' windows feature the Latin phrase "tibi dabo" ("I'll give you") and the mountain's name, while the choir level includes founding saints like Marcellin Champagnat and Jean-Baptiste de La Salle on either side of the presbytery. Anthony Mary Claret, Joseph Calasanctius, John Bosco, and Maria Domenica Mazzarello are depicted next to the main facade. The four facades have stained glass windows dedicated to revered figures such as Francis de Sales, Pius XI, Ignatius of Loyola, Francisco Javier, Pius IX, Rose of Lima, Leo XIII, and Pius XII. Finally, the dome's eight stained glass windows depict scenes from the life of Jesus.
In 1950, Josep Miret crafted a colossal bronze statue of the Sacred Heart, adorning the top of the church. This statue was installed in place of the original one created by Frederic Marès in 1935, which got destroyed the following year with the commencement of the Spanish Civil War. The journey from the crypt to the church and culminating at the sculpture symbolizes the elevation and purification of the human spirit through sacrifice and penance.
The crypt exhibits a blend of Gothic, classical, and Modernisme styles, with its neo-Byzantine design. Its space comprises of five naves separated by columns, with semicircular apses, and the central nave being wider. The walls and vaults are either lined with alabaster or adorned with mosaics depicting scenes related to the altars' dedications - Mary Help of Christians, Saint Anthony of Padua, the Blessed Sacrament, Saint Joseph, and the Virgin of Montserrat.
Josep Miret sculpted the Via Crucis (Stations of the Cross) using polychrome alabaster. The stained glass windows, complementing the natural light, feature Our Lady of the Pillar, King Reccared I's conversion to Catholicism, Saint Ferdinand, Saint Hermenegild, Joachim, Isidore the Farmer, Saint Anthony, and Saint Elizabeth of Portugal.
Furthermore, a chapel dedicated to the Perpetual Adoration, accessed through the crypt, was excavated into the mountain in the late 1940s. It has three naves divided by columns, and its interior is adorned with marble, mosaic pavements, and paintings by Miquel Farré i Albagés in the vaults, created between 1947 and 1949.
Two staircases on either side of the main door outside the crypt lead to the temple's level.