STOCKHOLM (AP) -- Sweden woke Monday to the prospect of weeks of political uncertainty after the country's two rival blocs failed to secure a clear governing majority in elections that saw a boost for a far-right party amid growing discontent with large-scale immigration.
With most of the ballots counted, the governing center-left bloc had a razor-thin edge over the center-right opposition Alliance, with roughly 40 percent each.
Sunday's election saw the Sweden Democrats, an anti-immigrant party with roots in a neo-Nazi movement, win about 18 percent, up from the 13 percent it gained four years earlier.
The party, which has worked to moderate its image in past years, gained on a backlash against the challenges of integrating hundreds of thousands of immigrants that arrived in the Scandinavian nation over the past years.
Prime Minister Stefan Lofven, who brought the Social Democrats to power in 2014, said he intended to remain in the job. The center-left party emerged with the greatest share of the vote — 28.4 percent as the count neared completion — yet looking at holding fewer parliament seats than four years ago.
The leader of the Moderates party that came in second, Ulf Kristersson, has already called on Lofven to resign and claimed the right to form Sweden's next government.
The center-right, four-party Alliance has said it would meet Monday to discuss how to move forward and demand that Lofven, head of the minority, two-party governing coalition, resign.
Final election returns were expected later in the week. The preliminary results made it unlikely any party would secure a majority of 175 seats in the 349-seat Riksdag, Sweden's parliament.
With the prospect of weeks or months of coalition talks before the next government is formed, Swedish tabloid Expressen headlined its front page Monday: "Chaos."
Both the left-leaning bloc led by the Social Democrats and the center-right bloc in which the Moderates is the largest of four parties have said they would refuse to consider the Sweden Democrats as a coalition partner.
Lofven told his supporters the election presented "a situation that all responsible parties must deal with," adding that "a party with roots in Nazism" would "never ever offer anything responsible, but hatred."
"We have a moral responsibility. We must gather all forces for good. We won't mourn, we will organize ourselves," he said.
Sweden — home to the Nobel prizes and militarily neutral for the better part of two centuries — has been known for its comparatively open doors to migrants and refugees. Sunday's general election was the first since Sweden, which a population of 10 million, took in a record 163,000 refugees in 2015 — the highest per capita of any European country.
Turnout in the election was reported at 84.4 percent, up from 83 percent in 2014.