STOCKHOLM (Reuters) - Swedish Prime Minister Stefan Lovfen is set to lose power in a confidence vote in parliament on Tuesday, with no clear indication of who will replace him after an inconclusive election that saw a surge by the far right.

FILE PHOTO: Prime Minister and Social Democratic Party leader Stefan Lofven attends a news conference at the government headquarters Rosenbad in Stockholm, Sweden September 12, 2018. TT News Agency/Henrik Montgomery/via REUTERS

Voters delivered a hung parliament in the Sept. 9 election, with Social Democrat Lofven’s center-left bloc garnering 144 seats, one more than their center-right rivals, the Alliance, whose biggest party is the Moderates.

The anti-immigration Sweden Democrats, with 62 seats, are expected to side with the Alliance and vote to remove Lofven in Tuesday’s confidence vote.

“Our previous position that we do not have confidence in him remains,” Sweden Democrat lawmaker Mattias Karlsson said.

If Lofven loses Tuesday’s vote, he will remain as head of a caretaker government until a new administration is in place.

That could take weeks if not months, analysts say.

Swedish politics have been deadlocked since the general election with both mainstream blocs claiming victory and the Sweden Democrats holding the balance of power.

The main blocs have rejected offering support to each other and ruled out co-operating with the Sweden Democrats, a party with roots in the white supremacist fringe that has been shunned by all other parties since entering the Riksdag in 2010.

While Tuesday’s vote is likely to spell the end of the minority coalition of the Social Democrats and Greens, it remains unclear what the make-up of the next government will be.

Parliament voted for a speaker from the Alliance on Monday, handing the four-party coalition a slight advantage. The speaker’s main task is to pick a prime ministerial candidate who is tasked with forming a viable administration.

“I think that the Alliance has the best potential to form a government, that has not changed,” Ulf Kristersson, Moderate Party leader and the Alliance’s candidate for prime minister, said.

“But there are many obstacles in the way and there are a number of steps before we get there.”

The complicated maths of the parliament make it far from certain the Moderates, Centre, Liberal and Christian Democrats that together form the Alliance can take power.

To avoid relying on the Sweden Democrats, who want to freeze immigration and hold a vote on the country’s EU membership, the Alliance hopes that the Social Democrats or Greens will support them, a proposal Lofven has already rejected.

Instead, he hopes to detach the Centre and Liberal parties from the Alliance and form a centrist government. The Social Democrats have dominated Swedish politics for decades and are still easily the biggest party.

The Sweden Democrats have promised to vote down any government that does not give them influence over policy, particularly on immigration. So far no party has shown any willingness to compromise.

“Because everyone has ruled out cooperating with the Sweden Democrats, the traditional blocs have to cooperate with each other,” Liberal Party leader Jan Bjorklund said.

“If some kind of cooperation does not happen, Sweden will have a fresh election.”

The speaker has four goes at picking a prime minister to form a government. If none of his choices can get enough support in parliament, a new election must be held within three months.