President Tayyip Erdogan's strong backing for Azerbaijan in the conflict over Nagorno-Karabakh has set Turkey apart from other big nations and alarmed NATO allies that are demanding a ceasefire.
But for Erdogan, the resolute stance is a strategic priority and a costly necessity that reinforces his strategy of flexing military muscle abroad to retain support at home.
The president has described Ankara's support for Azerbaijan as part of Turkey's quest for its "deserved place in the world order."
He sees an opportunity to alter the status quo over Nagorno-Karabakh - in which France, the United States and Russia have for decades led international mediation efforts and ethnic Armenians have retained control of the enclave even though it is internationally recognised as part of Azerbaijan.
"Turkey's logic in almost all corners of the map is disruption. Anything that undermines the status quo is good for it, because the previous status quo was seen to counter its interests," said Galip Dalay, fellow at Robert Bosch Academy.
"In Nagorno-Karabakh there was a frozen conflict in which it remained in Armenia's hands. Turkey wants to undermine this game even if it cannot fully determine it" given Russia's traditional influence in the region, he said.
Turkey's stance - sending an implicit threat to Armenia and a message of caution to Russia, which has a defence pact with Armenia - reflects its confidence in drone warfare used in Syria, Libya and Iraq, political analysts said.
Turkish-made drones are now spearheading Azeri attacks and one senior official in Ankara told Reuters that Turks were providing infrastructure and support for the weapons, though there are no troops in the field.
Erdogan is also betting that, despite their differences over Nagorno-Karabakh, Turkey and Russia get on well enough to prevent a wider conflict in the region.
YEARS OF "NEGLECT"
Russia, the United States and France have led calls for a ceasefire over Nagorno-Karabakh but Erdogan says they have neglected the crisis over the past three decades and should not lead peacemaking. Turkey says a lasting peace will depend on proposals being made for what happens after hostilities end.
Erdogan's stance had worsened a war of words with France, whose population includes many of Armenian origin, but it is accepted by Turkey's main opposition parties.
Military successes and the flexing of military muscle in other parts of the world have helped his ruling AK Party, allied with nationalists, retain an edge in opinion polls despite a currency depreciation that has worsened economic fallout from the coronavirus pandemic.
Erdogan's job approval rose nearly 5% last month, according to MetroPoll research group, after a standoff with the European Union over Mediterranean territorial rights.
"All of these conflicts out there boost the perception that Turkey is a country under siege, rightly or wrongly," said Sinan Ulgen, chairman of the Istanbul-based EDAM think tank.
But he said that "ultimately it's the economy that determines the political contest."
OBLIGATION AND PRIORITY
Two economic contractions in as many years have halted the boom years under Erdogan, and Moody's ratings agency says Turkey risks a balance-of-payments crisis after a nearly 25% drop in the lira this year.
Ankara's reliance on gas imports from Azerbaijan, which jumped 23% in the first half of 2020, are also an incentive to take a firm position on Nagorno-Karabakh.
Defence spending jumped 16% this year to $7 billion, or 5% of the overall budget, and the military budget has soared nearly 90% in a decade.
But cross-border campaigns such as those waged by Turkey in northern Syria, Iraq and Libya are a priority for Erdogan, a second Turkish official said.
"Neither the pandemic nor the deterioration of the budget will be an obstacle to defence spending," the official said. "It's not preferable but it's obligatory. Turkey is in the field with the United States and Russia. We cannot think or act small."
A diminished US presence in the region has left gaps that Turkey and Russia have sought to fill, using diplomacy to help contain conflicts in Syria's Idlib province and in Libya, two protracted proxy wars in which they are on opposing sides.
Ankara has denied allegations - including by Russia - that it has sent Syrian mercenaries to support Azerbaijan.
Close cooperation with Moscow in many areas means "there is no concern over being dragged into a conflict with Russia," the second official said.