Left-wing former judge Manuela Carmena, who took power there on Saturday, has vowed to make the Spanish capital cleaner, more just and less corrupt after 24 years with the conservative Popular Party (PP) in charge.
Observers say she will have quite a job, while businesses and investors are getting nervous, bracing themselves for higher taxes and stern scrutiny of rich building projects.
With 3.1 million residents, most aged between 25 and 59 years, it is among the richest of Spain's cities, but also one of its most indebted and divided.
“The inequality is enormous,” said Pascual Berrone of the IESE Business School, co-author of the Cities in Motion Index, a ranking of 148 world metropolises.
With more than a quarter of a million people jobless, Madrid's unemployment rate is more than 16 percent overall.
That is far lower than the national average, but disproportionate for a city with a per capita annual income of €36,800 ($41,500).
“There are neighbourhoods where unemployment is virtually zero and others where it is more than 20 percent,” said Berrone. “You can't have that in a modern city.”
The index ranks Madrid as the 35th best city worldwide right behind Barcelona. But they rank among the lowest for “social cohesion”.
Of the study's various criteria, Madrid ranks higher for public transport – seventh overall.
But locals were annoyed by a rise in price of transport at the height of the crisis — 4.6 percent in 2013, which campaigners said penalized the poor.
Madrid also has a pollution problem, with environmental groups complaining that poisonous emissions from car exhausts regularly exceed European safe limits.
– Selective gentrification –
Much of the city centre has been gentrified over the decades since the “Movida” party scene erupted in the 1980s after Spain's transition to democracy.
Teresa Sanchez, 45, has worked since she was a girl in the newspaper kiosk her father set up in the 1970s in the Chueca party district.
“This used to be a druggy neighbourhood. Very few people lived here,” she said. “Now it is richer, prettier, more modern. But ordinary people do not have any money.”
Luxury handbag stores sparkle in the posh central Salamanca district and the towering edifice of Real Madrid's Bernabeu football stadium is a world-renowned beacon of Madrileno pride.
In the past two decades, the city's leaders have tidied up the banks of the Manzanares River, turning them into a zone of parks and footpaths.
Historic neighbourhoods such as Malasana and the literary Las Letras neighbourhood near the Prado museum have been renovated, attracting contemporary art galleries and bookshops.
Spain's arts sector has suffered in the crisis, but alternative cultural centres have meanwhile thrived across the city, such as the Tabacalera, a community venue in a old tobacco factory.
– Feeding the poor –
In sprawling southern neighbourhoods such as Vallecas and Carabanchel, however, families are frequently evicted from their homes because they are not able to pay their mortgages.
Carmena has promised to set up an office to mediate between banks and struggling homeowners.
“We can't wait, not one minute” to stop them, she said. She has also vowed to spend €79 million a year in food aid for more than 100,000 needy Madrileños.
Outgoing conservative mayor Ana Botella has been credited with starting to lower the city's debts – from about €7 billion euros in 2013 to less than €6 billion last year.
But she has been a divisive figure — one of the top PP bogeymen for the left.
A two-week strike by street-sweepers in November 2013 left rubbish piling up in the gutters of Madrid as Botella defied their protests against salary and job cuts before a deal was done.
– Building projects halted –
Along with Barcelona's new mayor Ada Colau, Carmena is one of the first leaders emerging from the “Indignado” social protest movement to hold elected office, after campaigning for social justice and an end to corruption.
Carmena says she will audit some of the big building projects of recent years “to detect possible unjustified cost overruns and bad management”.
One massive development project worth €6 billion, dubbed “Operation Chamartin”, which aims to build 17,700 new homes and several highrises in northern Madrid, has been put on hold awaiting the green light from the new city hall.
By Roland Lloyd Parry / AFP