This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

BERLIN (AP) — Berlin’s first conservative mayor in 22 years took office on Thursday following a state election in which he capitalized on discontent in the German capital. Amid divisions in his own coalition, he had a rocky start.

Kai Wegner’s center-right Christian Democratic Union, Germany’s main opposition party, emerged as the biggest party in the February rerun election that was ordered by a court because of serious glitches in the previous vote in 2021. The CDU celebrated winning in a big city, which it has struggled to do in recent years, while all three parties in Berlin’s outgoing left-wing government lost supporters.

The center-left Social Democrats of German Chancellor Olaf Scholz had led Berlin since 2001, most recently under former federal minister Franziska Giffey.

The state legislature elected Wegner as mayor on Thursday after Giffey decided that her party would be better served by becoming the CDU’s junior coalition partner than by continuing to lead a weakened and often rancorous left-wing alliance. Members of her party narrowly gave their blessing in a ballot conducted over recent weeks.

Likely reflecting divisions in Giffey’s party, Wegner needed an unusual three rounds of voting to get enough support from lawmakers.

Giffey becomes Wegner’s economy minister. She will be part of an 11-member regional government that includes seven women and the CDU’s first Black minister at state level, music manager Joe Chialo — the incoming culture minister.

Voters were angered by the 2021 election chaos and what, by German standards, is a dysfunctional bureaucracy — in recent years, getting basic paperwork done in Berlin has often entailed lengthy waits even to get an appointment. Wegner has pledged to take personal charge of reforming the city’s administration.

There is also simmering discontent over rising apartment rental costs, long an issue in Berlin — one of three German cities that are states in their own right. The country’s 16 state governments have significant powers in many policy areas.

Wegner, 50, will be keen to make his mark quickly as his government has unusually little time to prove itself. It will only serve out the five-year term that started with Berlin’s botched September 2021 election.