The last time the Pelourinho was restored, in the 1990s, the pastel facades were repainted, the cobblestones relaid and most of the people who lived there sent away. Three decades later, Salvador is trying again, and this time the city says the people are the point.

The state of Bahia and the city of Salvador began work this month on a 320 million-real program, about $58 million, to rebuild 140 dilapidated 18th- and 19th-century houses in the district, a UNESCO World Heritage site and the historic heart of Afro-Brazilian culture. Under rules adopted after months of negotiation with neighborhood associations, half of the 460 apartments produced will be reserved for families currently living in the buildings, at rents capped at 20 percent of household income.

“In 1992 they gave people a bus ticket and a small payment and told them the Pelourinho was for tourists now,” said Jorge Luiz dos Santos, 71, who was moved to a distant suburb as a young man and returned to the district in 2008 to squat in a roofless mansion on the Ladeira do Carmo. “We are still here. This time they are at least asking.”

The earlier restoration is a textbook case of what planners call heritage gentrification. By 2000 the district’s population had fallen from about 9,000 to under 3,000, and dozens of restored buildings, their ground floors turned into shops, stood empty above. Many have since deteriorated again. A survey by the state heritage institute in 2024 found 230 buildings in the district at risk of collapse, and a wall fell onto a street in June, injuring two people.

The new program draws on a model used in Lisbon and Havana, where public agencies restore buildings and then rent rather than sell apartments. The Bahia state housing company will retain ownership, with a cooperative of residents managing day-to-day maintenance.

“The buildings do not survive without people in them,” said Ana Paula Figueiredo, the architect coordinating the project. “A house that is a shop by day and empty by night rots from the top. We want kitchens, laundry on the line, children on the stairs.”

Critics on the business side worry that the subsidized housing will crowd out investment. Hotel operators argue that the district needs higher-end accommodation to compete with Rio de Janeiro and Recife. On the community side, some leaders doubt that the 50 percent set-aside will survive the next election.

Construction on the first 22 buildings, on the Rua Gregório de Matos, is scheduled to finish in 18 months. Residents of those buildings have moved into temporary housing a few blocks away, with a written guarantee of return that lawyers from the Federal University of Bahia helped draft.

Mr. dos Santos, who sits on the residents’ cooperative board, keeps his copy folded in his shirt pocket. “Paper is not a house,” he said. “But it is more than they gave us last time.”