Other cities and towns around the country swore in new council members and mayors.
The leadership change comes weeks after Spain's two largest traditional parties were punished in nationwide local elections by voters groaning under the weight of austerity measures and repulsed by a string of corruption scandals.
In Madrid, 71-year-old retired judge Manuela Carmena was among the first mayors to be sworn in, ending 24 years of rule by the conservative Popular Party in Spain's capital.
In Barcelona, anti-eviction activist Ada Colau is due to be sworn in this evening. Colau questioned whether it's worth spending 4 million euros (USD 4.5 million) of city money to help host the glitzy Formula 1 race every other year. She thinks the funds would be better spent on free meals for needy children at public schools.
The political fragmentation propelling Carmena and Colau into office marks a historic moment in Spanish politics, said Manuel Martin Algarra, a communications professor at the University of Navarra who specializes in public opinion.
"Madrid and Barcelona for the first time are not going be governed by political parties, but by coalitions made up of social movements," he said. "This was a punishment vote to the traditional political establishment in Spain."
