Sweden faced political deadlock on Monday after the far-right made gains in legislative elections that left the question of who will form the next government up in the air.

The prime minister is usually the leader of the party with the most votes, but Sweden's fragmented political landscape after Sunday's vote makes it impossible to predict who will build the next government, a process likely to take weeks, AFP wrote.

The far-right Sweden Democrats, with roots in the neo-Nazi movement, solidified their position as third-biggest party, though they have yet to shake their pariah status.

Far-right parties have gained strength in elections in recent years in several European countries, including Germany and Italy. Far-right leaders in Austria, Italy and France hailed the strides made by the Sweden Democrats.

"However the dramatic bloc battle plays out, it looks like it will be difficult for Sweden to have a functioning government," paper of reference Dagens Nyheter predicted.

Lofven met Monday with his party leadership to map out his road ahead.

Parliamentary group leader Anders Ygeman said "it could take weeks, maybe even months" before Sweden had a government in place.

Lofven's bloc enjoys a razor-thin one-seat lead over the opposition Alliance.

The Social Democrats won 28.4 percent of votes, down 2.8 points from the 2014 elections, their worst score in a century.