Andersson was first chosen to be prime minister last week, but she quit the same day after her proposed budget was defeated and the coalition government she hoped to lead broke down.
Now she has again been appointed to the role by Sweden’s Parliament, and intends to form a minority government of only her own party.
She will officially begin the role after a meeting with the country’s King on Tuesday — a stage that she did not reach last week.
Andersson was appointed through a razor-thin vote in Sweden’s divided Parliament. While 101 MPs voted for her, 173 voted against, and 75 abstained. Under the country’s rules, a new prime minister can be elected as long as a majority of lawmakers do not vote against them.
As Prime Minister, Andersson was preceded by 33 men. She will replace Stefan Löfven, who stepped down as both the country’s premier and as leader of the Social Democrats party earlier this month and has since been leading a caretaker government.
But her position will once again be an uncomfortable one, given Sweden’s fragmented political landscape. Andersson’s Social Democrats hold 100 seats in the 349-seat Parliament, meaning the party will still have to rely on support of other parties to pass legislation.
Her predecessor Löfven governed by performing a complex juggling act to secure support from both the Left and Center parties in Parliament, which were not part of the coalition government. But the Center Party pulled out from supporting Andersson’s budget last week, sinking her first attempt to become leader.
After the fresh vote on Monday, the Swedish Social Democrats tweeted, “We will break the segregation and push back the violence, create the green jobs of the future by leading the way in climate change and regaining control of welfare. Led by Magdalena Andersson – our Prime Minister!”
She must present her governmental appointments to the King on Tuesday in a formal meeting known as the Council of State.
Andersson has served as Sweden’s finance minister since 2014. She previously worked as deputy director-general of the Swedish Tax Agency.