Magdalena Andersson, who resigned seven hours after being chosen as Sweden’s first female prime minister last week, has again been selected for the top job.
She emerged triumphant after another vote in the Swedish parliament on Monday.
It was a narrow affair. There were 173 votes against her, two more and she would have lost.
Last week, just hours after being chosen, Andersson's budget proposal was defeated in parliament and she lost the support of the Green Party from her coalition.
A government that had taken weeks of negotiations to form, was quickly toppled.
The speaker of Sweden’s parliament (Riksdag), Andreas Norlén, said he “regretted” what happened on Wednesday, and after polling party leaders once again he concluded that the votes would be there once again to elect Andersson.
The three parties that brought her to power earlier indicated they will again allow her to be elected.
That turned out to be the case on Monday. The 54-year-old economist is now expected to be sworn in as head of government for good this time, succeeding Stefan Löfven.
This time she will head up a single-party minority government, consisting just of her Social Democrats.
Although she was elected for a few hours to this position last week with a single vote margin before finally having to resign, she had not officially taken office.
What happened the first time around?
Andersson, as leader of the Social Democrats, had managed to secure just enough support in a coalition agreement to secure the votes in parliament for her bid for prime minister.
The last-minute agreement was thanks to an agreement with the Left Party to increase pensions.
This however led the liberal Centre Party to reject her budget, without blocking her accession to power.
That afternoon parliament approved a budget from the right-wing opposition, which was prepared for the first time with the far-right Sweden Democrats.
The Social Democrats’ coalition partner, the Greens, refused to govern with a budget formed in partnership with the far-right, so her government effectively collapsed.
"There is a constitutional practice that a coalition government resigns when a party leaves. I don't want to lead a government whose legitimacy is questioned," Andersson explained at a press conference.
"This is a historic situation, but I expect Andersson to be re-elected prime minister on Monday," said Anders Sannerstedt, professor of political science at Lund University.
"She will now lead a one-party government. So no more surprises. No more crisis, at least for now," he continues.
Who is in the new government?
On Tuesday, Andersson formally presented her one-party minority government, with only minor changes.
Mikael Damberg -- Sweden's former home affairs minister -- has been nominated to replace Andersson as finance minister.
Ann Linde will remain Sweden's foreign minister, while Peter Hultqvist was also kept as defense minister.
The Greens had held the environment and culture ministries in the previous government, but they have now been replaced by the Social Democrats.
The new cabinet comes less than a year before the September 2022 parliamentary elections, which are expected to be close.
Meanwhile, the new Swedish Minister of Schools, Lina Axelsson Kihlblom, is set to become the country's first transgender citizen to hold a government post.
With some 25% in the polls, the Social Democrat party is still the largest political party in Sweden, but is close to its historical lows.
The ascension of Magdalena Andersson to the top job in politics marks a milestone in Sweden, which although has for decades been seen as one of the most progressive countries in Europe, has never had a female PM.
In a speech to parliament, Center Party leader Annie Loof said a female prime minister “means a lot to many girls and women, to see this glass roof shattered. I am proud that (the Center Party) is involved and makes this possible.”
Her party abstained from voting for or against Andersson, paving the way for her election.