Swedes head to the polls Sunday with Prime Minister Ulf Kristersson’s center-right party slightly behind the center-left Social Democratic Party led by Sweden's former prime minister, Magdalena Andersson, and the election dominated by fears of mass migration, crime and the economy.

"Years of gang violence, Islamist extremism, persistent unemployment and pressure on public services have intensified the debate over whether integration has kept pace with immigration," foreign policy expert and author Daniel Schatz, told Fox News Digital.

After Germany's AfD victory in a state election last week, Sweden's hard-right Sweden Democrats are in a position to enter government if Kristersson's party wins again. 

The Associated Press reported that the anti-immigration party has shifted toward the political mainstream and is likely to get cabinet posts. It has so far supported the Kristersson government from the outside.

The Associated Press reported that the Sweden Democrats were founded by activists in far-right-wing extremist groups, including neo-Nazis. But since then, under its leader, Jimmie Åkesson, it toned down that rhetoric and kicked out racist members. Åkesson, who has led them since 2005, is said to be responsible for the success of a once marginal party. 

Sweden, once a model of the Western social welfare state, has been under economic strain as governments from both the left and the right were forced to restructure their welfare system.

While social benefits continue to be extensive, Sweden’s welfare state has changed amid rising crime rates, but the expectations for public benefits remain.

"Sweden went from being described as a ‘humanitarian superpower’ to a 'humanitarian basket case.’ Discontent with migration policies extends to both foreign-born and native-born residents. Shootings have declined sharply, but fewer shootings do not mean the integration problems are solved," Schatz, who is Swedish, added.

Prime Minister Kristersson’s government took power in 2022, when the nation was experiencing a dramatic rise in gun-related violence, with the country witnessing 391 shootings resulting in 62 deaths, according to The Swedish National Council for Crime Prevention, a government agency under the Ministry of Justice.

The homicide rate in Sweden has been on the rise since 2013, when gun homicides contributed to a general increase in Sweden’s total homicide rate.

The Swedish National Council for Crime Prevention notes that Sweden’s homicide rate ranks high compared with other European countries, at approximately four deaths per million inhabitants per year.

The average for Europe is approximately 1.6 deaths per million inhabitants.

The issue of immigration is another major issue that dovetails with voters’ concerns over crime and gun violence. Like much of Europe, Sweden experienced a wave of immigration in 2015 coming from those fleeing the Syrian civil war as well as the wars in Iraq and Afghanistan.

Sweden took in over 160,000 asylum seekers in 2015, or 12% of all those who sought protection in the EU, according to Sweden’s Migration Agency.

"After the 2015 influx of asylum seekers from Syria and other war-torn countries strained its reception system, Sweden began tightening its borders. The current government has taken that shift much further," Schatz said.

Prime Minister Kristersson’s parliamentary ally, the right-wing Sweden Democrats, filled the void in the anti-immigration position in parliament.

Nicholas Aylott, professor of political science at Södertörn University in Stockholm, told Fox News Digital the link between the increase in immigration and the rise in crime changed Swedish politics.

"Migration and law and order became much higher electoral priorities," Aylott said.

"The Sweden Democrats based their pitch on them. The other parties, rather belatedly, adapted their positions. The Sweden Democrats had at first been completely ostracized by the other parties, but they were gradually accepted as a legitimate partner by three of the other parties of the right between 2018 and 2022," he said.

As anti-immigration backlash rose and the Sweden Democrats were more included in the policymaking process, Sweden cracked down on immigration and made it harder to seek asylum.

While asylum claims dropped and gun violence was dramatically reduced as well, with only 158 shootings and 44 fatalities to date, the government still might suffer a defeat at the hands of Andersson’s center-left coalition.

The Associated Press contributed to this report.