Pope Benedict XVI has consecrated Antoni Gaudi's unfinished church, the Sagrada Familia, as a basilica in the Spanish city of Barcelona.
The Pope sprinkled holy water on the altar before a congregation of more than 6,500 people.
Gaudi's greatest work has been under construction for more than a century, and will not be finished before 2026.
The current chief architect said he hoped the Pope's visit would provide the boost needed to finish the work.
Before leaving for Rome from Barcelona's El Prat airport, Pope Benedict called on Europe's Catholics to renew their faith.
"May this faith find new vigour on this continent and become a source of inspiration," he said at the end of the two-day visit.
In his earlier homily, he again criticised divorce, same-sex marriage and abortion.
He was seen off by dignitaries including Prime Minister Jose Luis Rodriguez Zapatero, King Juan Carlos and Queen Sofia.
Sagrada Familia is currently funded by private donations and visitors' fees.
Following the consecration, the main nave is now open for daily Mass for the first time.
Work began on Barcelona's Sagrada Familia (Expiatory Temple of the Holy Family) in 1882, based on a design by Francisco de Paula Villar, who envisioned a simple church in a traditional neo-Gothic style.
But after he resigned in 1883, Gaudi was appointed the lead architect and redesigned the church entirely. His imaginative plans included 18 spires and five naves, rich with decorated organic detailing.
He once said it was an expression of "the divine history of the salvation of man through Christ incarnate, given to the world by the Virgin Mary".
In 1911, the devout Catholic devoted himself entirely to the project, and spent the next 15 years living and working on site as a virtual recluse, supervising work. He died in 1926, after being run over by a tram.
Already a Unesco world heritage site visited by millions, it will become the world's tallest church when the 170m (560ft) central tower is erected.
In preparation for the Pope's visit, workers covered the central nave and installed stained-glass windows.
Crowds lined the streets to greet the Pope as he drove to the church.
There was also a protest by about 200 gay activists who staged a "kiss-in".
"We are here to demonstrate against the Pope's visit and call for a change in the mentality of the Catholic institution which still opposes our right to different ways of loving," said one protester, Sergi Diaz.
In Santiago de Compostela on Saturday, the Pope warned of an "aggressive anti-clericalism" in Spain which was akin to that experienced during the 1930s.
The comments were a reference to the civil war era, during which Republicans killed thousands of priests and nuns, and burned churches.
Despite opposition from the Roman Catholic Church, Spain's Socialist-led government has introduced laws allowing gay marriage, fast-track divorce and easier access to abortions.
This is Pope Benedict's second visit to Spain since his election, and a third visit is planned next year for World Youth Day, a sign of how important the Vatican considers the health of the Church in the country.
Only 14.4% of Spaniards regularly attend mass, and legal changes to allow divorce, gay marriage and abortion have caused concern to the Church. But 73% of Spaniards still define themselves as Catholic.