ANKARA, Turkey — Turkey and Russia promised on Wednesday not to go to war over the downing of a Russian fighter jet, leaving Turkey’s still-nervous NATO allies and just about everyone else wondering why the country decided to risk such a serious confrontation.

The reply from the Turkish government so far has been consistent: Don’t say we didn’t warn you.

Though minor airspace violations are fairly common and usually tolerated, Turkey had repeatedly called in Russia’s ambassador to complain about aircraft intrusions and about bombing raids in Syria near the border. President Recep Tayyip Erdogan said on Tuesday evening — and a Pentagon spokesman later confirmed — that before a Turkish F-16 shot down the Russian Su-24 jet, Turkish forces had warned the Russian plane 10 times in five minutes to steer away.

“I personally was expecting something like this, because in the past months there have been so many incidents like that,” Ismail Demir, Turkey’s undersecretary of national defense, said in an interview. “Our engagement rules were very clear, and any sovereign nation has a right to defend its airspace.”

While that may be true, analysts said Mr. Erdogan had several more nuanced reasons to allow Turkish pilots to open fire. These include his frustration with Russia over a range of issues even beyond Syria, the Gordian knot of figuring out what to do with Syria itself and Turkey’s strong ethnic ties to the Turkmen villages Russia has been bombing lately in the area of the crash.

Turkey has been quietly seething ever since Russia began military operations against Syrian rebels two months ago, wrecking Ankara’s policy of ousting the government of President Bashar al-Assad. The Turks were forced to downgrade their ambitions from the ouster of Mr. Assad to simply maintaining a seat at the negotiating table when the time comes, said Soner Cagaptay, a Turkish analyst at the Washington Institute for Near East Policy, a nonpartisan research group.

“That would require Turkey-backed rebels to be present in Syria, and I think Turkey was alarmed that Russia’s bombing of positions held by Turkey-backed rebels in northern Syria was hurting their positions and therefore Turkey’s future stakes in Syria,” Mr. Cagaptay said. “So this is also an aggressive Turkey posture in the Syrian civil war to prevent the defeat of Turkey-backed rebels so they can hold onto territory and have a say in the future of Syria.”

But the fate of the particular rebels the Russians were bombing in the mountainous Bayirbucak area where the plane was shot down is more than just a policy matter to the Turks. Mr. Erdogan particularly emphasized the ethnic tie in a speech Tuesday evening, saying, “We strongly condemn attacks focusing on areas inhabited by Bayirbucak Turkmen — we have our relatives, our kin there.”

The Turkish prime minister, Ahmet Davutoglu, said as much on Wednesday while dismissing Russia’s explanation that it was fighting a common enemy, the Islamic State. “No one,” he said, “can legitimize attacks on Turkmens in Syria using the pretext of fighting the Islamic State.”

The bombing was creating political problems for Mr. Erdogan, Mr. Cagaptay said. “In the days leading up to the incident, many newspapers, especially the pro-government publications, were running headlines highlighting the suffering of the Turkmens, who are closely related to Anatolian Turks,” he said. “I think the government felt that, in terms of domestic politics, it had to do something to ease some of this pressure that had resulted from the Russian bombardment against Turkmens in northern Syria.”

Russia’s bombing of Turkmen villages was to be the principal issue Turkey raised with Russia’s foreign minister, Sergey V. Lavrov, in talks that had been set for Wednesday but were canceled after the shooting down of the plane.

Mr. Erdogan’s emphasis on helping the Turkmens has another important political dimension in Turkey. Mr. Erdogan’s political party emphasized Turkish ethnic identity and Sunni Muslim faith in the campaign leading up to critical elections on Nov. 1, as it competed with one rival party heavily composed of Turkey’s Kurdish minority and another committed to preserving Turkey’s status as a secular society and state.

Mr. Erdogan managed an important victory in that election, preserving his chances of winning legislative approval to change the Constitution and turn the country’s parliamentary system into a presidential one.

Complicating matters further, Turkey and Syria have a longstanding border dispute in exactly the area where the Russian plane, a Sukhoi Su-24, was shot down, and Russia has sometimes voiced support for Syria’s claim. It is a narrow strip of territory, the Hatay Province of Turkey, that runs south along the Mediterranean Sea, deep into Syria.

The province is a melting pot of ethnic Turks and Arabs. It is also a religious mélange, with many Muslims but also a large Christian population, as Hatay includes the biblical city of Antioch. And the province has an acrimonious history.

The League of Nations granted Hatay Province to France after World War I as part of France’s legal mandate over Syria. Ethnic Turks led the province’s secession from Syria and declaration of an independent republic in 1938, and that republic then joined Turkey the next year — much as Texas seceded from Mexico a century earlier, became a republic and soon joined the United States.

Syria has periodically questioned the loss of Hatay over the years. “If you look at Syrian maps, that province, that chunk of territory, is shown as belonging to Syria,” said Altay Atli, an international relations specialist at Bogazici University.

When Hatay seceded from the French mandate of Syria, Hatay’s borders did not encompass all of the ethnic Turks in the area; many Turkmens remained just across the border in what is now northernmost Syria. For decades, it was difficult for families divided on either side of the border by the secession of Hatay to even visit one another. Tensions finally began to ease during the years immediately before the Arab Spring, but they have resumed in the last several years as Turkey has led calls for the removal of Mr. Assad.

The fact that Russia has over the years expressed sympathy for Syria’s claim to Hatay makes the province even more delicate for Turkey, and Tuesday’s incident with the Russian jet even more important, said James F. Jeffrey, a former American ambassador to Turkey who is now a fellow at the Washington Institute for Near East Policy.

He questioned whether the Russian jet had strayed into Hatay Province’s airspace accidentally or whether Russia might have been deliberately allowing incursions by its jets during military activities in Syria because of Hatay’s tangled history.

The Russian and Ottoman Empires battled for centuries for control over the area from the Balkans to the Black Sea, and vestiges of that bloody rivalry keep arising. One of those is reflected in Turkey’s deep concern about Russia’s annexation of Crimea from Ukraine, said Murat Yesiltas, the director of security studies at the Foundation for Political, Economic and Social Research, a large research group in Ankara with close government links.

Turkey now faces across the Black Sea a much wider arc of territory occupied by Russian forces. Many in Turkey are further upset by Russia’s treatment of the Crimean Tatars, who speak a Turkic language and have opposed the Russian annexation. Most of the Crimean Tatars’ leaders have been forced into exile by Russia, and this week Tatars have been blocking repair crews from restringing crucial power lines to Crimea that were mysteriously blown up over the weekend, producing a nearly total blackout on the peninsula.

“Turkey wants to protect the territorial integrity of Ukraine,” Mr. Yesiltas said. Turkey has already provided economic assistance to Ukraine, but it has been reluctant to confront Moscow more publicly because Russia is one of Turkey’s biggest export markets and supplies three-fifths of Turkey’s natural gas.

With President Vladimir V. Putin of Russia saying things about the jet’s downing like, “We will never tolerate such crimes like the one committed today” and warning of “serious consequences,” the biggest question perhaps is what comes next.

Russia on Wednesday announced plans to deploy its most modern air-defense system, the S-400 mobile antiaircraft missile, to its air base outside Latakia. But while most experts — and Mr. Erdogan himself, in remarks on Wednesday — play down concerns of a wider confrontation, many worry that the biggest losers from Tuesday’s incident could be the Turkmens.

While the jet’s two crew members were able to eject from the plane, Russia said that one of them was killed — possibly by fire from the ground as he floated to earth — as was a marine sent in a helicopter that was shot down by local ground forces while trying to rescue the pilots; the Kremlin said the second crew member had been rescued by Russian special forces.

Several experts warned that Mr. Putin may step up his country’s attacks on the Turkmens in retaliation.