ISTANBUL — As Russian warplanes fly over Syria, neighboring NATO member Turkey says its fighter jets could open fire on them if they stray into Turkish airspace. The threat is serious and highlights the danger of a direct military confrontation between Russia and its old Cold War adversaries, including not just Turkey but the United States.

Tensions between Ankara and Moscow over Russia’s stepped-up military involvement in the Syrian war escalated sharply on Monday when Turkey revealed two of its F-16 fighters intercepted a Russian jet that had crossed into Turkish airspace over the town of Yayladagi in the border province Hatay.

The two countries are rivals in the Syrian conflict, with Turkey calling for an end to the rule of Syrian leader Bashar al-Assad and Russia presenting itself as Assad’s most important ally.

“Our rules of engagement are clear, whoever it is,” Prime Minister Ahmet Davutoglu told private broadcaster Haberturk. “Even if a bird violates Turkey’s borders, necessary steps will be taken.” He added that Russia had assured Turkey that the airspace violation had been a mistake and would not happen again. Turkish military officials in Moscow were told by Russian officials a “navigation error” had led the pilot to leave Syrian airspace, Turkish media reported.

Turkey’s foreign ministry summoned the Russian ambassador over the incident that happened around noon local time on October 3.

“The Russian aircraft exited Turkish airspace into Syria after it was intercepted by two F-16s from the Turkish Air Force, which were conducting patrols in the region,” the ministry said. The ambassador was warned that, should another incident like that happen again, “the Russian Federation will be responsible for any undesired incident that may occur,” a clear warning that Russian jets could come under fire next time.

Turkish Foreign Minister Feridun Sinirlioglu called his Russian counterpart Sergey Lavrov to protest against the airspace violation and asked NATO General Secretary Jens Stoltenberg for a meeting that was scheduled to take place later on Monday. The U.S. and other NATO countries have deployed Patriot anti-missile defense system near the Turkish border with Syria, although the weapons are due to be withdrawn from Turkey this month.

In the unlikely but not impossible event that Turkish and Russian aircraft open fire on each other, or planes from either country are downed by anti-aircraft missiles on the ground, the chances of escalation are serious. Turkish President Recep Tayyip Erdogan is facing tough new elections and cannot look weak. Russian President Vladimir Putin has taken a major gamble launching Russia’s first official expeditionary operation since Afghanistan in the 1980s. He could suffer a dangerous loss of face if one of his aircraft is shot down.

Meanwhile, the U.S. and other NATO members could be drawn in under Articles 5 and 6 of the NATO treaty, which commits them to defend all members of the alliance.

Even before the latest confrontation, the skies near the Turkish-Syrian border were extremely tense, with Syria, Russia, Turkey, and the U.S.-led coalition forces flying in the area. American warplanes have been operating recently out of Turkey’s Incirlik Air Base, a NATO site that is only about 100 miles from the base at Latakia, Syria, being used by the Russians.

In another incident, unidentified MiG-29 jets locked their radar onto two other Turkish F-16s that were on a routine flight along the border, the Turkish military said. The MiGs were likely to be have been Syrian aircraft, as there are no MiG-29s among Russia’s warplanes in Syria, according to U.S. officials.

Last week, a Turkish security official told Reuters that Turkish radar had locked onto another Russian warplane that was bombing Syrian targets near the border, adding that the Russian jet would have been attacked by Turkish fighters if it had crossed into Turkish airspace.

Following an incident in 2012, when Syrian air defense batteries shot down a Turkish surveillance jet, killing the two pilots, Ankara toughened the rules of engagement for its military units along the Syrian border. Under the new guidelines, Turkish jets shot down a Syrian military helicopter near the border in 2013 and a Syrian warplane in 2014. In May this year, Turkish jets brought down another Syrian aircraft. While Ankara said it was a helicopter, Damascus identified the aircraft as an unmanned drone.

Turkey has sharply criticized Moscow’s decision to launch airstrikes in Syria in support of Assad. Prime Minister Davutoglu, echoing criticism directed against Russia by the West, has said the Russian strikes hit Western-backed rebels of the Free Syrian Army (FSA) and had helped to strengthen so-called Islamic State (ISIS) jihadists in Syria.

Russia says it is helping Assad to fight ISIS, but Western governments and news reports say there is hardly any ISIS activity in several areas bombarded by Russia thus far. Non-ISIS Islamic rebels who drove out Syrian government troops in recent months dominate the Syrian region close to Hatay province where the airspace violation of October 3 took place.

For Ankara, Russia’s intervention in Syria’s four-year-old war has thrown a wrench into several plans for the conflict across its southern border, especially a proposal to create a “safe zone” in northern Syria, one of the regions where Russian aircraft have started operations.

Officially, Ankara says this safe zone would secure the return of hundreds of thousands of Syrian refugees who have streamed into Turkey and further on to the European Union. But observers say the real aim of the zone would be to thwart efforts by Syria’s Kurds, allies of the PKK Kurdish rebel group inside Turkey, to set up an independent state in Syria.

It is unlikely that Russia, a world power and one of the UN Security Council’s five permanent members, would agree to the Turkish plan. Moscow has said it will not agree to the creation of a no-fly zone over Syria, a vital part of the Turkish plan to organize a safe zone on the ground.

A day after the incident involving the Russian jet became public Erdogan, clearly frustrated, slammed Russia’s involvement in Syria as a “grave mistake” as well as “quite unacceptable” and “worrying and disturbing.”

For Erdogan, anger over Putin’s actions in Syria is personal. Only two months ago, Erdogan confidently told Turkish reporters he saw a change in Russia’s long-standing support for Assad and that Moscow could be about to “drop” the Syrian president, Turkey’s arch-foe. When Russia then strengthened its support for Assad, Erdogan said Putin had told him different things behind closed doors.