STOCKHOLM (Reuters) – Swedish Finance Minister Magdalena Andersson will have a shot at becoming the Nordic country’s first female prime minister after the speaker picked her on Thursday to try and form a government from a fragmented parliament.

Andersson was elected by the Social Democrat party to replace former Prime Minister Stefan Lofven as its chairperson last week. Lofven handed in his resignation as prime minister on Wednesday.

“It was, therefore, natural that the Social Democrat’s new chairperson would have the first opportunity to try to form a government,” Speaker Andreas Norlen told reporters.

The speaker said he had asked Andersson to report back on Tuesday, but that he was willing to give her more time if talks on forming a government were making progress.

Lofven led a shaky, minority government with the Greens from 2014.

It relied on support from parties on the left and right and Andersson will also need to find support from outside the current coalition to win a confirmation vote in parliament.

While she does not need a majority in the 349-seat house to back her as prime minister, she must avoid a majority voting against her.

Her biggest obstacle now is reconciling demands by the Left Party for their support with those of her other would-be backer, the centre-right Centre Party, which rejects any dealings with the formerly communist Left.

(Reporting by Simon Johnson; editing by Niklas Pollard)