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.
A former junior swimming champion from the university city of Uppsala, Ms Andersson began her political career in 1996 as political adviser to then-Prime Minister Goran Persson.
She has spent the past seven years as finance minister before becoming leader of the Social Democrats at the start of November.
She replaced Stefan Lofven, who resigned as prime minister after seven years in power.
Until Ms Andersson took over, Mr Lofven had remained prime minister of a caretaker government after being ousted in an unprecedented vote of no confidence in June.