SALVADOR, Brazil — Baroque architectural gems grace this city. Musicians enthrall audiences with high-octane performances reflecting Salvador’s status as a bastion of Brazil’s popular culture. Luxury residential towers overlook a stunning harbor. The industrial park on the city’s outskirts contains cutting-edge plants opened by Ford and other multinational corporations.

Salvador, the largest city in northeastern Brazil, a region that is still posting enviable economic growth even as the national economy slows, should have the wind at its back. But the boom here is producing another outcome: Instead of celebrating Salvador as its residents have long done — the writer Jorge Amado once called it a laid-back place of “eternal beauty” — many people here are increasingly revolted by their city.

In what may serve as a cautionary tale for other cities in the developing world, Salvador’s rising prosperity, on display in new shopping malls, sprawling megachurches and well-guarded gated communities, exists alongside a troubled reality. A surge in violent crime has transformed Salvador into Brazil’s murder capital, motorists grapple with traffic that ranks among the most chaotic and violent of any South American city and resentment festers over the metamorphosis of once-elegant seaside districts into crime-ridden areas with abandoned buildings best described as ruins.

“Our political leaders are of such mediocrity that it is hard to comprehend,” said Antonio Risério, a writer and historian who has chronicled Salvador’s origins as Brazil’s first capital, from 1549 to 1763, and the cradle of African-Brazilian culture. “We’re not a failed city, but we’re a place where the middle class lives in fear,” added Mr. Risério, among the most acerbic critics of how Salvador has recently changed.