Magdalena Andersson during a press conference after the budget vote. Pic: AP

Magdalena Andersson resigned as Sweden’s first female prime minister on Wednesday hours after she was appointed because her government’s coalition partner suffered a budget defeat in parliament.

In a dramatic development, Ms Andersson, leader of the Social Democratic Party, said at a press conference: “I have asked the speaker to be relieved of my duties as prime minister.”

“I am ready to be prime minister in a single-party, Social Democrat government,” she added.

Her resignation came after her coalition partner, the Green Party, quit the two-party coalition after the government’s budget bill was rejected.

The Green Party said it could not accept a budget “drafted for the first time with the far-right,” reported BBC.

Ms Andersson’s decision to step down came hours after she said earlier that she would not, in case she lost the budget vote.

“I am of the opinion that [the opposition budget] as a whole is something I can live with,” she had said before the budget vote.

However, after the budget vote Ms Andersson told reporters that the Green Party’s decision had forced her to step down.

“A coalition government should resign if a party chooses to leave the government. Despite the fact that the parliamentary situation is unchanged, it needs to be tried again,” she said.

For the budget vote, Ms Andersson had sought support from two smaller parties, the Centre Party and the Left Party.

The budget was defeated after the Centre Party withdrew support, even though Ms Andersson had struck a last-minute deal with the Left Party to secure support for the budget.