After 137 years of ongoing construction, Barcelona's Sagrada Familia received a building permit Friday.

Construction on the basilica is expected to be completed in 2026.

Architect Antoni Gaudí began his work on Sagrada Familia in 1883, and in 1914 stopped all other projects to work exclusively on  the basilica, to which he dedicated himself until his death in 1926.

"It was a historical anomaly that La Sagrada Familia did not have a license," said Janet Sanz, deputy mayor for Ecology, Urbanism and Mobility, according to NPR.

"They were working on the church in a very irregular way," she said. "And we were very clear that, like everyone else, La Sagrada Familia should comply with the law."

A permit had been applied for in 1885, but the city's council never responded to the application. Three years ago, the authorities discovered that the building did not have the proper paperwork.

La Sagrada Familia foundation purchased the building permit and signed a contract with the city June 7. It is the most expensive building permit in the city's history, at about $5.1 million dollars.

Per the agreement, the city will be involved with the preservation and completion of the basilica. The foundation will also be co-responsible for the revenue the building brings to the city.

Though unfinished, Sagrada Familia was consecrated in 2010 by Benedict XVI.

The church receives about 4 million visitors per year. Under the contract, the foundation will not seek to increase the amount of the visitors. A new metro station will also be built to provide visitors with direct access to the church and to help decrease traffic in the surrounding area.

A date for the project's completion has been set for 2026, 100 years after Gaudí died in a car accident. Since his death, the progress has been based off the artist's plaster models and copies of his drawings, which had been partially destroyed in a fire set during the Spanish Civil War, and which were later reconstructed.

The architect was a devout Catholic and has numerous modernist architectural pieces throughout Barcelona. His cause for canonization was opened in Rome in 2003.

 In 2005, Sagrada Familia was declared a UNESCO World Heritage Site.