Sweden's Social Democrats and their center-left allies are poised to return to power after defeating the center-right government, in a general election that also resulted in strong gains for the anti-immigration party.
With all voting districts tallied by Monday morning, the Social Democrat-led bloc won 43.7 percent of the vote while the ruling center-right coalition, led by the Moderate Party, gained 39.3 percent.
But the anti-immigration far-right Sweden Democrats were celebrating large gains as the party won 12.9 percent of votes cast — more than doubling the 5.7 percent of votes won in the 2010 election and possibly giving it the balance of power in a vote with no clear majority.
"Sweden friends, party friends, now we're Sweden's third-largest party," party leader Jimmie Akesson told cheering supporters late on Sunday.
About 200,000 votes, or three percent of the electorate, remain uncounted. Most of the ballots are from expatriates.
With no majority reached, a complicated process of forming a government is expected as the center-left pledged not to cooperate with the Sweden Democrats. The outgoing coalition has made the same promise.
The Social Democrats' leader and prime minister-designate, Stefan Lofven, a former union leader, reiterated this pledge in his midnight victory speech.
His party has said it would team up with the Greens, and in his speech, Lofven said he was "extending a hand" to "democratic parties", stressing that Sweden is facing a new parliamentary situation.
"It's time to put party interests aside," he said. "Our country is too small for conflicts."
The Social Democrats dominated Swedish politics during most of the 20th century and its single-party government ruled the country from 1994 to 2006 with support from allies.
The current prime minister, Fredrik Reinfeldt, who led the country during eight years of tax reductions and pro-market reforms, said he would hand in his resignation on Monday and also leave the leadership of the Moderates in spring. His center-right Alliance cut income and corporate taxes, abolished a tax on wealth and trimmed welfare benefits. It has also eased labor laws and privatized state-owned companies, including the maker of Absolut vodka.
Xenophobia and racism have been high on the election agenda, and polls predicted a rise by the far right. Sweden has some of the most generous asylum policies in the world, and 80,000 refugees from Syria, Eritrea, Somalia, Afghanistan, Iraq, and other countries are expected to arrive this year — the most since 1992.
The rise of the Sweden Democrats has unnerved many Swedes, who regard the party as racist despite its efforts to soften its rhetoric under Akesson.
The Sweden Democrats want to cut immigration by 90 percent and have campaigned against the "mixing of cultures” — especially lashing out at Muslim immigration.
Najat Mahamed, who moved to Sweden from Eritrea about 25 years ago, told Al Jazeera: "It's sad that so many people share their opinions, but we live in a democracy, so people need to be allowed to vote how they want."
Mahamed voted for the Greens, a party she normally does not support, hoping that it would become the third biggest party in parliament rather than the Sweden Democrats.
However, the Green Party won only 6.8 percent of votes.
Besides immigration, education, and unemployment, gender equality had been a prominent issue in the campaign.
Early exit polls suggested that the leftist Feminist Initiative had reached the four-percent threshold needed to enter the Riksdag, the national legislature, but the partial results gave the party only 3.1 percent.
Al Jazeera with wire services