Barcelona City Hall finally has issued a work permit for the unfinished church designed by architect Antoni Gaudi 137 years after construction started on La Sagrada Familia Basilica.
The city said on Friday it granted the current builders a licence that is valid until 2026.
Builders think that will be enough time to finish raising the landmark Roman Catholic church's central towers.
The basilica's first stone was laid in 1882, under the eye of the church's first architect Francisco de Paula del Villar y Lozano.
But, according to Sagrada Familia foundation, he stepped down shortly afterwards because of "differences of opinion with the developers".
Gaudi took over in 1883, scrapping the original plans after receiving a substantial donation towards the project and opting for a grander design utilising innovative structures and building techniques.
However, Barcelona officials said there was no record showing a building permit first requested in 1885 was ever granted or rejected.
Barcelona officials said the city will be paid 4.6 million euros ($7.4 million) in fees under an agreement negotiated with a foundation devoted to completing and preserving La Sagrada Familia.
The agreement between the city and the foundation puts an end to "a historical anomaly in our city," Barcelona official Janet Sanz said.
Over 4.5 million visitors pay between 17 and 38 euros ($27.50 and $61.50) each to tour the cathedral-sized church every year.
The Barcelona government estimates 20 million tourists stand outside to marvel at the bell towers.
Gaudi had envisioned 12 towers, one for each of Christ's disciples, and it is possible that vision may finally be realised.
When completed, one of the central towers will make the La Sagrada Familia the tallest religious structure in Europe at 172.5 meters tall.
Barcelona has the largest concentration of buildings designed by Gaudi, whose bold modernist aesthetic still inspires architects.
A fervent Catholic, he dedicated much of his professional life to Sagrada Familia, for which he incorporated elements of Christian symbolism along with the organic forms he often employed.
In November 1925, the 100-metre-tall bell tower dedicated to Saint Barnabas on the Nativity facade was completed.
Gaudi died in June 1926 after being stuck by a tram and was buried in the church crypt.
Ongoing construction work is based on the architect's plaster models, and photos and publications of his original drawings, which were destroyed in a 1930s fire.