Celia Wade-Brown has toppled Kerry Prendergast as Wellington mayor in the closest election race the capital has seen.
Ms Wade-Brown, of the Green Party, took the mayoralty after the counting of special votes was completed yesterday afternoon.
She beat three-term mayor Ms Prendergast by 176 votes (24,881 to 24,705), believed to be the closest mayoral race ever in the capital, after being behind by 40 votes on election day, council spokesman Richard Maclean said.
A total of 632 special votes were included in the result, he said.
Ms Wade-Brown campaigned for better public transport and light rail.
Ms Prendergast congratulated Ms Wade-Brown and said it had been an honour to serve as mayor for nine years.
"It goes without saying that I am tremendously disappointed at the outcome of the election. But I congratulate Celia and sincerely wish her all the very best for the huge job she now faces.
It has been the best job in the world, and I will miss it."
She had no immediate plans but would be able to spend more time with family.
"After working 12-hour days for nine years, it will be a huge change for me and it will take me some time to get used to it."
She expressed her thanks to friends, family, supporters and councillors and staff she worked with while mayor.
Ms Prendergast said before yesterday's result was known that the single transferable vote (STV) system could cost her the election.
She said Ms Wade-Brown could not beat her, but STV could.
Ms Prendergast was first elected Mayor of Wellington in 2001. She was the second woman to hold the post.