Islamist-backed candidate Souad Abderrahim defeated a city official who served under ousted despot Zine el Abidine Ben Ali on Tuesday to become the first woman mayor of the Tunisian capital.
"I dedicate this victory to all Tunisian women," Abderrahim said. "My first task will be to improve the face of Tunis."
Deteriorating waste disposal services have blighted the capital since Ben Ali's 2011 overthrow in the first of that year's Arab Spring uprisings.
The 53-year-old manager of a pharmaceutical firm, known for her trouser suits and blow-drys, has risen to the fore as one of the new faces of veteran Islamist party Ennahdha as it seeks to modernise its image.
Although she is a member of the party's politburo, she stood as an independent in the May 6 municipal election, in which she headed the Ennahdha list.
With 21 seats out of 60, the list emerged as the largest on the city council but well short of a majority.
Municipal elections in Tunisia were marked by low turnout by a public facing ongoing economic hardship and frustrated with political elites.
Across the country independent lists took the highest number of seats, winning 32.9 percent nationwide.
Abderrahim was elected mayor in a second round of voting by councillors which was boycotted by left-wing and centrist parties who refused to support the candidates of either of the main parties.
She defeated Kamel Idir, candidate of the Nidaa Tounes party of President Beji Caid Essebsi, by 26 votes to 22.
An activist during her university years, Abderrahim sat within the Ennahdha bloc of a new constituent assembly between 2011 and 2014.
During that time she caused controversy for her criticism of single mothers, before disappearing from the political scene until the May municipal elections.
The new mayor rejected the "Islamist" label, asserting she wanted to work with all parties.
"We have chosen transparency as a slogan," Abderrahim said.
The Ennahdha party in 2016 acknowledged the separation of religion and politics, describing itself as "democratic Muslim".
As municipal councils are being formed across Tunisia, observers say the proportion of female mayors could be relatively high.
According to the country's electoral commission (ISIE), women made up 47 percent of those elected in the recent local polls.