Swedish voters went to the polls Sunday amid a backdrop of concerns over immigration and rising crime.

The center-left bloc, led by Prime Minister Stefan Lofven’s Social Democrats, won 40.6 percent of the vote. The center-right alliance led by the Moderate Party came in narrowly second, with 40.3 percent, while the populist Sweden Democrats won 17.6 percent of the vote.

This leaves both the center-left bloc and the center-right alliance without the necessary 175 seats to comprise a majority. The center-left bloc will hold 144 seats while the center-right alliance will hold 142. Sweden Democrats will likely hold 63 seats.

The likely loss of 13 seats for the Social Democrats is a sharp rebuke to Lofven, who has held office since October 2014, leading a coalition government with the Green Party.

The Social Democrats have dominated Swedish politics for the last 100 years, having come in first in every national election since 1917. Now, immigration and crime concerns have brought that 100-year reign to an end.

Sweden has undergone major changes since the last parliamentary election in 2014. Heavily impacted by the migrant crisis, Sweden has taken in more migrants per capita since 2015 than any country in Europe, including 163,000 in 2015 alone.

Lofven made the case early on for an open policy toward migrants. In September 2015, speaking to a pro-migrant rally, he said, “We need to decide right now what kind of Europe we are going to be. My Europe takes in refugees. My Europe doesn’t build walls.”

But by November 2015, the government had begun to change course, with Lofven saying, “We need respite.” That same month, Sweden reintroduced temporary border controls, and just this past May ended up extending them for an additional six months.

The massive influx of migrants has come with an uptick in terror attacks and crime. In April 2017, a rejected asylum-seeker carried out a truck attack against pedestrians, killing five people and injuring nearly a dozen. Sweden has faced increasing gang violence, which is contributed to a dramatic increase in grenade attacks since 2014.

To this day, the news in Sweden is full of stories of rising crime, including 80 cars being burned in a coordinated attack in the city of Gothenburg last month. Three-fourths of Swedes say crime has increased over the past three years.

The data back this up. According to Sweden’s National Council for Crime Prevention, 2017 saw 4,010 more reported crimes than 2016. While Sweden has seen a decrease in some crimes like theft, other crimes—including sexual assaults—rose significantly during the same period. Rapes increased by 10 percent in 2017 alone.

There is also a massive employment gap between native Swedes and non-European immigrants to Sweden. While the unemployment rate overall is 6.9 percent, it is 16 percent among foreign-born Swedes, 23 percent among non-European immigrants, and only 4 percent for native Swedes.

The populist Sweden Democrats campaigned heavily on issues of crime and immigration. Those issues clearly resonated with the public, as Sweden Democrats have now gained 14 seats in parliament.

But the campaign was not without controversy. Just prior to the election, the Moderate Party—the main center-right opposition party heading into the election—lodged a complaint over social media postings by several Social Democratic candidates, many of whom subsequently resigned or were suspended.

The posts reportedly falsely accused the Moderate Party and Sweden Democrats of “accusing Muslim parents of crimes in order to take their children away,” and planning to “remove citizenship from anybody who arrived in the country after 1970.”

Other issues, which factored into the election included concerns over health care wait times and middling educational performance in the Nordic nation.

Sweden Democrats are now in position to play kingmaker. Yet, prior to the election, all the other parties stated they would not form a coalition with the Sweden Democrats, as some founding members of the Sweden Democrats had roots in neo-Nazism. So the parameters of a future government coalition are unclear.

BBC reported that Sweden Democrats’ current leader, Jimmie Åkesson, “became leader in 2005 and pursued zero tolerance toward racism in the party. Several members were expelled.”

The rise of Sweden Democrats from 12.9 percent in 2014 parliamentary elections to 17.6 percent in 2018, and the decline of the Social Democrats, can be attributed in large part to the Lofven government’s handling of the migrant crisis, alongside concerns that the Swedish welfare state cannot cope with the costs. Sunday’s results were the worst for the Social Democrats in a century.

In addition, outside actors worked to influence the election. In January, Anders Thornberg, who heads Sweden’s SAPO Security Service, stated in an interview that Russia represented the greatest threat from foreign political interference.

A report from the Swedish Defense Research Agency published in August found a doubling of fake Twitter accounts from July to August. While some bots expressed support for far-left parties, the research found fake accounts were 40 percent more likely than genuine ones to express support for the Sweden Democrats.

One reason may be that Sweden Democrats continue to oppose Swedish membership in NATO, while the center-right parties are united in their support for Swedish NATO membership.

Whichever party forms Sweden’s next government, the impacts of the 2018 election—created by an undercurrent of public discontent—are sure to have a lasting impact on Swedish politics.