When Antoni Gaudí began working on the Sagrada Familia in 1883, it was located in an undeveloped area outside Barcelona. In 1885, he received a letter authorizing construction from the town of Sant Martí de Provençals, before it was annexed by Barcelona, as the city grew. This document has been the only official building permit—until this October.

The builders who continue to work on Gaudí’s unfinished masterpiece and Barcelona mayor Ana Colau recently reached an agreement to end more than 130 years of legal limbo, while construction proceeded without a proper license. This “administrative silence” was tolerated by previous mayors, but in recent years, as local architecture journalist Llàtzer Moix told record, the protests of neighborhood residents over the impact of the church’s surging tourist traffic—some 4.5 million visitors per year—prompted the mayor of the Catalonian city into action.

The terms of the agreement include a payment to the city, over 10 years, of 36 million euros ($41 million) by the building’s Construction Junta, overseen by the Catholic Church. The funds are not a fine, municipal officials say, but will address the impact of the project on public services. Twenty-five million (in U.S. dollars) will go to improving public transportation citywide, $8 million for a new access point from the local metro station to the church, $4.56 million to reconfigure the surrounding streets, and $3.4 million toward their maintenance. The metro stop and pedestrianized streets will be designed in consultation with the residents.

With an estimated annual income of U.S. $90 million from ticket sales and an annual construction budget of roughly $60 million, according to data from the Sagrada Familia, the payments will not affect the rhythm of construction. Work is scheduled to finally finish in 2026, on the centennial of Gaudí’s death.

But the agreement will not include Gaudí’s proposal to extend a monumental stair and avenue from the main “Glory Facade” through two city blocks, which would mean destroying hundreds of apartment units. This controversial idea—if ever pursued by the Sagrada Familia—would require further negotiations.