Swedish voters have turned away from the centre-right Alliance coalition of Fredrik Reinfeldt after eight years, and Social Democrats leader Stefan Lofven says he is prepared to form a government with other parties on the left.
The far-right, anti-immigration Sweden Democrats have become the country's third largest party with close to 13% of the vote but Mr Lofven has insisted he will not look to them to help form a government.
Sweden receives more asylum applications per capita than any other European country, and recently offered permanent residency to all Syrians fleeing the war there. The Swedish Democrats are the only party which opposes the country's immigration policy, and Sunday's result more than doubled their seats in parliament to 49. They first entered parliament in 2010.
Yet all the mainstream parties still consider them to be too radical to work with.
"I will not," Stefan Lofven, the incoming prime minister.
"We need a strong government. Our party and I will take the responsibility so that Sweden will get a strong government not depending on the Sweden Democrats," Mr Lofven said.
That means he might have to cross the floor and try to secure the votes of parties on the right of centre - the outgoing government - on a case-by-case basis.
The Sweden Democrats survived a string of scandals in the run-up to the election, including the publication of a picture of a party official wearing a Nazi symbol, and the revelation that party leader Jimmie Aakesson has a problem with online gambling.
Many of their election rallies were met with mass demonstrations, and took place with a heavy police presence.
"I am very surprised and sad," said Ingrid Bjoerenson, a Stockholm resident who came to protest at a Sweden Democrats rally the day before the election.
"They were here before as well, just to get the attention of the media and to provoke, because this is not an area where they have many voters," she told BBC News.
Indeed, it is hard to find anyone who will admit to supporting the Sweden Democrats, despite their strong showing in these elections.
"For many years you had a bunch of small, marginalised parties fighting for the position to be the big, anti-immigration party, and the Sweden Democrats won that fight," said Daniel Poohl, leader of the Expo foundation which maps far-right extremism in Sweden.
He believes the party's success is not necessarily a sign that public opinion on immigration is turning, but rather proof of their ability to build a palatable image.
"In the 2006 election they grew away from the other small marginalised parties, and since then they have been the trademark for anti-immigration in politics."
Ulf Bjereld, a politics professor at Gothenburg University, agrees.
"The Swedish people has not changed their view, but those who think like the Sweden Democrats think, they have been mobilised to vote for them."
Mr Reinfeldt's centre-right Alliance had steered Sweden through the economic crisis with relative success compared to many other European countries, without cuts to public spending.
"The welfare state has a very strong standing in Swedish public opinion," said Ulf Bjereld.
"The reason the Alliance and Fredrik Reinfeldt and his Moderates Party could succeed in winning two elections [in 2006 and 2010] was because he promised very hard not to change the Swedish welfare system.
"But in 2006 they had a vision for how they would develop the Swedish state. Today they have fulfilled their promises but they haven't been so successful in formulating a new vision."
The Social Democrats say they want to raise taxes on business to boost spending on education, jobs creation and welfare. But with a minority in parliament, and faced with a stronger than ever Sweden Democrats, the incoming government faces an uphill battle.