Two provocative incidents in Stockholm this month have energised Turkish President Tayyip Erdogan ahead of tight elections and dimmed Sweden and Finland's hopes of joining NATO before the summer, diplomats, analysts and opposition politicians say.
Erdogan was quick to thrust the issue of NATO expansion into domestic politics after a copy of the Muslim holy book, the Koran, was burned at the weekend, and an effigy of the Turkish leader was strung from a lamppost a week earlier.
The incidents, while not illegal in Sweden, hobbled Stockholm's effort to win Ankara's support for its bid to join U.S.-led NATO, which Sweden made last May alongside Finland in the face of Russia's invasion of Ukraine.
For Erdogan, it was an opportunity to rally support and distract from a cost-of-living crisis weighing on voters' minds, analysts said, with polls showing he could lose to some presidential challengers in the May 14 vote.
Facing his biggest political test in two decades in power, he took a stance that has proven effective before - criticising perceived Islamophobia in Europe and support for "members of terrorist organisations and enemies of Islam" in Sweden.
Leaders of the opposition alliance looking to topple Erdogan and his Islamist-rooted AK Party scrambled this week to fall in line with his view, and even take a harder line.
Meral Aksener, leader of the IYI Party, parliament's fourth-biggest, said it would take "an even more concrete step" and file a criminal complaint against both the Swedish government and perpetrators of the "vile act".
"Erdogan and his fellows want to use these foreign policy issues in general for domestic political gains," she told party members on Wednesday.
The main opposition Republican People's Party (CHP) also condemned the incidents in Sweden and said they would serve Erdogan's re-election campaign.
The Koran was set alight on Saturday by a far-right Danish politician, while earlier a pro-Kurdish group strung up the Erdogan effigy. Both incidents were criticised by Swedish government officials.
But Erdogan said this week that Sweden could no longer expect Turkey's support for its NATO bid, and Ankara cancelled a planned trilateral meeting. Finland said the sides need a "time out" for a few weeks until "the dust has settled".
WAITING GAME
All 30 NATO member states must approve newcomers.
To address Turkey's concerns, Sweden and Finland pledged last summer to take a harder line against what Ankara labels as mainly Kurdish "terrorists" - allegedly linked to PKK separatist militants in Turkey's southeast - living there.
Washington, Stockholm and Helsinki had hoped Ankara would ratify the NATO bids before Turkey's election. But that prospect faded even before the Stockholm protests, given Erdogan's calls for dozens of extraditions and deportations that Swedish law would not allow.
Ozer Sencar, chairman of pollster Metropoll, said that amplifying foreign policy and security issues ahead of elections allows Erdogan to consolidate his voter base.
He "creates a perception of a 'strong leader' inside Turkey," he said. "If you can come up with a security problem, then people rally behind the strong leader."
Both Swedish and Finnish officials have acknowledged that Turkey's reaction to their membership bids - and security concerns - has had domestic political dimensions.
"Of course they feel the pressure from the upcoming elections in mid-May and because of that the discussion understandably has become heated in many ways in Turkey," Finnish Foreign Minister Pekka Haavisto told Reuters.
He said Turkey is likely to ratify the Nordic countries' membership after the May presidential and parliamentary elections, and before a NATO summit in Vilnius on July 11-12.
But a Western diplomat who requested anonymity said the issue was "completely taken over by election politics" and that ratification could come as late as October, when the Turkish parliament reconvenes after the summer.
While Erdogan's government backs the Nordics' NATO bid with conditions, his political opponents had been more supportive - before the Stockholm incidents.
ECONOMY TRUMPS FOREIGN POLICY?
His AK Party, now the biggest, is likely to remain a powerful force in parliament after the elections, but opinion polls show Erdogan trailing some potential presidential challengers including CHP leader Kemal Kilicdaroglu and the popular mayors of Istanbul and Ankara.
Erdogan has sought to ease Turks' economic woes by delivering a large hike to the minimum wage this year and reducing the age limit for retirement for millions, among other fiscal stimulus measures.
But analysts say the economy will likely remain the determining factor for most voters rather than foreign policy.
Sinan Ulgen, director of the Istanbul-based Centre for Economic and Foreign Policy Studies and a former diplomat, noted that NATO enlargement is a non-partisan issue.
"This time the ruling and opposition parties have the same position on the (NATO Nordics) matter, so it does not seem to be a topic for domestic politics," he said.
(Writing by Huseyin Hayatsever and Ali Kucukgocmen, editing by Mark Heinrich)