“But people shouldn’t forget that nobody wanted to do anything to save these same neighborhoods a few years ago,” he added.

In 2010, my first article for The New York Times in Lisbon focused on Portugal’s antiquated tenancy rules, which could leave a landlord renting two identical apartments in the same building, but one for less than 3 percent of the other’s price.

Portugal had a long history of antagonism toward landowners, dating back to the 1910 revolution that ended the monarchy. Then, during a long military dictatorship, rents were frozen in Lisbon and the northern city of Porto.

Fixed rents for new contracts were abolished more than a decade after another revolution, which overthrew the dictatorship in 1974 but not for existing contracts, and downtown Lisbon remained a partly derelict area shunned by locals.

When Portugal received its bailout, the inner city had 552,700 inhabitants and 322,865 housing units, of which 50,289 stood vacant, according to the most recent census of 2011. A year later, the new rental law came into force that liberalized the housing market.

Politicians sought to lead by example. In 2011, António Costa, who was then mayor of Lisbon, moved his city hall administration from its historic headquarters to a former tile factory building at the corner of Intendente, a square known for drugs and prostitutes.

Mr. Costa is now Portugal’s prime minister and Intendente is almost unrecognizable. It has a handicraft shop, cafes and several construction projects in the works. In the center stands a garden, surrounded by red forged-metal barriers designed by Joana Vasconcelos, one of Portugal’s best-known artists.