This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

STOCKHOLM (AP) — A populist anti-immigration party has surged to become Sweden’s second-largest political force after a national election dominated by fears of gang violence, which has given the once-safe Scandinavian country one of Europe’s highest levels of gun violence.

Overall, a conservative opposition bloc including the anti-immigration party, the Sweden Democrats, had an extremely narrow lead over the incumbent center-left with 94% of the votes counted.

Analysts expect the final tally will confirm a conservative bloc win, but the election was so close that electoral officials said they would not have the final result until outstanding postal votes and votes from abroad are counted.

With eight parties contending for seats in the 349-member Riksdag, Sweden’s parliament, none can secure a majority of 175 seats, meaning that laws can only be passed with different parties working together. The parties campaigned under two general blocs, one conservative and the other a center-left group headed by Prime Minister Magdalena Andersson, Sweden’s first female prime minister.

The not-yet-final count indicated that the conservative bloc would have 175 seats and the center-left would have 174.

“It is extremely close. Things can change, but I doubt it,” said Zeth Isaksson, a sociologist at Stockholm University, who added that votes from abroad are traditionally conservative. “As it is now, it is more likely that the right side will win.”

One certainty, however, is that the result marked a success for the right-wing populist Sweden Democrats, which won its best result since entering parliament in 2010. The party’s founders in the 1980s had links to fascist and neo-Nazi movements but over the past two decades it has worked to move to the mainstream under its 43-year-old leader Jimmie Akesson.

Its transformation included changing its official logo from a torch to a flower and expelling the most radical members.

Those who support it like its tough vows to crack down on crime and strictly limit immigration, while opponents fear that its historic roots make it a threat to Sweden’s democratic identity.

Mark Johnson, a 50-year-old Swedish finance worker, said while the party’s strong showing was expected, it is still shocking for many Swedes because “it’s hard to understand that we would be taking such an obvious turn to the right, to the far-right even.”

The Sweden Democrats, which won 20.6% support in Sunday’s vote, according to preliminary figures, up from 17.5% four years ago, gained on the rising fears of crime in largely immigrant neighborhoods.

This year so far there have been 273 shootings, 47 of them fatal, according to police statistics. Those shootings also wounded 74 people, including innocent bystanders.

Andersson’s Social Democrats, who have been in power in Sweden since 2014, remain the largest party, even gaining slightly to take 30.5% of the vote Sunday, according to the incomplete results. Andersson said Sunday night it was obvious that the social democratic movement, which is based on ideals of creating an equal society and a strong welfare state, remains strong in Sweden.

The Sweden Democrats wants to be part of a government, but this is unlikely to happen because there are parties in the center-right bloc that oppose it, Isaksson said.

Richard Jomshof, the Sweden Democrats’ party secretary, said Monday: “It is clear that we must be able to discuss ministerial posts. It is clear that we must be able to talk about the position of prime minister, speaker of parliament and the presidium positions in the various Riksdag committees.”

But a senior member of the center-right Liberals told Swedish radio Monday that it cannot allow the Sweden Democrats to be part of a government.

Still, if the right prevails, the Sweden Democrats will have “very strong leverage” and will push for some of its issues, like tightening immigration laws, Isaksson said. He said a likely outcome could be for the Sweden Democrats to end up outside a government but as supporters of it.

In Germany, the far-right Alternative for Germany party congratulated the Sweden Democrats on “their sensational success in the parliamentary elections.” France’s far-right leader Marine Pen also tweeted her congratulations to the “patriotic” Swedish party, saying: “Everywhere in Europe, people aspire to take their destiny back into their own hands!”

Isaksson also ruled out a governing coalition combining the center-right Moderates, which have been leading the center-right bloc, and the Social Democrats. Such a coalition has not occurred since World War II.

The Moderates dropped to become Sweden’s third-largest party and won 19% support, based on the incomplete vote tally. However, party leader Ulf Kristersson on Monday appeared to be the most likely candidate to be the next prime minister. He told his supporters that he stands ready to try to create a stable and effective government.

Andersson, a 55-year-old economist, became Sweden’s first female prime minister less than a year ago and led Sweden’s historic bid to join NATO following Russia’s invasion of Ukraine in February.

___ Olsen reported from Copenhagen, Denmark. Frank Jordans in Berlin contributed.