Franziska Giffey, a former German cabinet minister who was forced to resign last year in a plagiarism scandal, is set to become Berlin’s first female mayor after a day of historic electoral gains for her center-left party. According to preliminary results, her party won 21 percent of the vote, narrowly beating a candidate from the Greens party with 19 percent.

The 43-year-old candidate for the Social Democrats took to social media on Monday to thank her supporters — who said it was “about time” a woman led the capital and described her as someone who gets things done.

“Thank you all very much,” Giffey tweeted, admitting that the race had been close and at times uncertain.

The local election in Berlin fell on the same day as national parliamentary elections that saw German Chancellor Angela Merkel’s Christian Democrats post their worst results, coming in second to the Social Democrats for the first time in more than a decade and a half.

The outgoing chancellor’s party was also routed in another local vote in Mecklenburg-Western Pomerania, a state that decisively reelected Manuela Schwesig, another female politician with the Social Democrats.

“This evening belongs to the women,” Schwesig tweeted on Sunday evening. “The women who, well over a hundred years before us, ensured that we had the right to vote and that we could stand for election.”

Merkel, Germany’s first female chancellor, is preparing to step down after 16 years as the country’s leader.

Giffey, in her new role as mayor of the capital, has said she plans to focus on the economy, education and sustainability.

But one challenge that she will face is how to deal with the results of a controversial referendum held in Berlin on Sunday. Some 56 percent of Berliners voted to seize back thousands of apartments from corporate landlords in a radical move against gentrification and skyrocketing rents.

The vote was no-binding, but it put politicians under pressure to act more decisively to make housing more affordable in the city.

Speaking to a Berlin radio station on Monday, Giffey said she would “respect” the results of the referendum and go about drafting a bill. However, the draft would have to be legal under constitutional law.

Attempts to forcibly expropriate housing will face a slew of legal challenges but are still likely to unsettle investors.

Giffey overcame a turbulent period during which she resigned from her role as federal minister for family affairs in Merkel’s national government in May, amid recurring allegations that she plagiarized her doctoral dissertation in 2010.

“The government, my party and the public have a right to clarity. I have decided to ask the Chancellor to relieve me of the office of minister,” Giffey said in a statement at the time.

Defending herself from the allegations, Giffey said she wrote the thesis “to the best of my ability,” but added: “I regret it if I made mistakes in this.”

An investigation conducted by Berlin’s Free University, which Giffey attended, in response to the claims found that Giffey had not correctly attributed information to authors cited in her thesis and that some of the content had been lifted from other works.

In June, the university board said it would strip Giffey of her doctorate, a title she no longer uses as a result of its decision.

Following the scandal, Giffey said she would use the time to focus on the upcoming elections and noted that her goals for the German capital include boosting jobs and the economy, inclusive education and protecting the climate.

While Giffey is the first woman to be elected Berlin mayor since the reunification of the city, another woman previously served as mayor after World War II, as Berlin was being divided. Louise Schroeder was governing mayor of Berlin during the post-war governments and mayor of West Berlin from 1949 to 1951.

Giffey will take over from the Social Democrats’ Michael Müller, who has held the post of Berlin’s governing mayor since 2014 but opted not to run again in this election.

After entering politics at the age of 29, Giffey has worked as the European commissioner for the Neukölln District and city councilor for education, schools, culture and sport.