Sweden's first female prime minister has been reappointed to the top job after political turmoil forced her to resign within hours of taking the post last week.
MPs backed Social Democratic Party leader Magdalena Andersson by a narrow margin in a new vote on Monday.
She will attempt to lead a one-party government until an election in September next year.
She stood down as PM last Wednesday after her coalition collapsed.
Just hours earlier, Ms Andersson had been elected as Sweden's first female prime minister by a single vote in parliament.
But the 54-year-old economist's plan for forming a new coalition government with the Green Party was thrown into disarray when her budget proposal failed to pass.
Instead, parliament voted for a budget drawn up by a group of opposition parties, including the far-right Sweden Democrats.
The Green Party said it would not accept a budget drafted by the far-right and walked away from the government, leading to its demise.
By convention, the prime minister in Sweden is expected to resign if a coalition party leaves government.
In Monday's vote in Sweden's parliament, the Riksdag, 101 of its 349 members voted yes, 75 abstained and 173 voted no.
To be appointed prime minister under Sweden's political system, a candidate only needs to avoid a majority voting against them.
At a news conference after the vote, Ms Andersson said she was ready to "take Sweden forward" with a programme focused on welfare, climate change and crime.
But without the support of other parties, Ms Andersson will struggle to pass legislation in parliament, where the centre-left Social Democrats hold 100 of 349 seats.
Political soap opera far from over
After a week of drama, Magdalena Andersson's prime ministerial career is back on track, but Sweden's political soap opera is far from over.
Ms Andersson still has to implement a budget put together by some of her right-wing rivals. Plus, she's got to govern a fragile minority without the formal support of the Greens, who've been a crucial coalition partner since 2014.
All this has highlighted the complexities of having a deeply divided eight-party parliament. Some political commentators here are worried that Ms Andersson's chaotic rise to power may have dented trust in the entire political system.
Once formed, Ms Andersson's new government will remain in place until general elections, which are set to take place in September next year. Until then, she's got just over nine months to prove herself to the public.
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.