Magdalena Andersson, the newly elected Swedish prime minister, resigned on Wednesday — hours after she was appointed — when her coalition partners, the Greens, quit the government. Ms Andersson <a href="https://www.thenationalnews.com/world/europe/2021/11/05/swedens-likely-next-pm-magdalena-andersson-vows-to-smoke-out-gang-violence/" target="_blank">was appointed Sweden’s first woman prime minister</a>, taking office with pledges to tackle gang crime and preserve the country’s cherished welfare state, and stepped down after a parliamentary defeat over the proposed budget. The politician said she was ready, however, to try again to become the next prime minister in the tightly split Parliament. “I understand that this may look very messy and what has happened is completely unique,” Ms Andersson said. Ms Andersson, 54, had won a vote in Parliament and formally assumed power on Friday. It was the final hurdle to the premiership after she was elected leader of the Social Democratic Party, the largest group in the Riksdag. She won support from green and left-wing groups in the Swedish Parliament after promising to help struggling pensioners and make the country a model in climate policy. Another bloc, the Centre Party, said it would allow Ms Andersson's confirmation to pass to prevent a right-wing government from taking power with support from the populist Sweden Democrats. With 117 votes for Ms Andersson, and 57 abstentions, she met the requirement of there being no majority against her. But the Centre Party said it would not support a budget tabled by Ms Andersson's partners, clouding the picture for the new government. Ms Andersson has not ruled out continuing in the prime minister role of a minority government or in a renewed coalition. “For me, it is about respect, but I also do not want to lead a government where there may be grounds to question its legitimacy,” Ms Andersson said after stepping down. Even though the Green Party pulled its support for her government, it said it is prepared to support her in a new vote for the next prime minister. But the Greens also defended their decision not to approve the coalition budget, the move that led to Ms Andersson's resignation. Ms Andersson was finance minister under Stefan Lofven, who <a href="https://www.thenationalnews.com/world/europe/2021/08/23/race-begins-to-take-on-swedens-challenges-after-pm-quits/" target="_blank">announced in August</a> that he would not lead the Social Democrats into the 2022 election. Sweden's strong finances have been credited with helping it weather the Covid-19 pandemic, in which it has broken ranks with most of Europe by shunning lockdowns and putting little emphasis on face masks. She has pledged to leave “no stone unturned” to <a href="https://www.thenationalnews.com/world/europe/2021/10/04/sweden-at-the-forefront-of-europes-battle-with-gangland-violence/" target="_blank">put a stop to gangland violence</a>, with authorities having reported that Sweden is the only country in Europe with steadily rising gun deaths. Gang violence has killed dozens of people this year, with rival mobsters using guns and explosives to settle scores. “We need a full-scale mobilisation to regain control from gangs that are holding entire neighbourhoods hostage,” she said last month. Although Sweden has long championed gender equality, it was the only Nordic country which had not previously had a woman prime minister. “A glass ceiling has cracked and Sweden has a new excellent and strong prime minister. A great day,” said Ylva Johansson, the country’s European commissioner.