Turkey will open fire on foreign planes violating Turkish airspace in the future, President Recep Tayyip Erdogan warned amid a diplomatic crisis caused by the downing of a Russian warplane by the Turkish Air Force.

“If another violation of our aerial border happens, we can respond in the same way,” he said. “The plane was shot down within the rules of engagement announced earlier.”

On Tuesday, a Turkish F-16 fighter jet fired at and downed a Russian warplane conducting a combat mission in Syria. Ankara maintains the Russian Su-24 bomber crossed the border and remained in Turkish airspace for 17 seconds.

Russia denies any violations. It also rejects Turkey’s claims that its military repeatedly warned the pilots of the Russian jet before attacking it.

Prime Minister Ahmet Davutoğlu told fellow members of his AK Party that he had personally authorized the rules of engagement.

“We have mentioned that we would take all the necessary precautions needed if these developments result in violation of Turkish airspace,” Davutoğlu said. “The orders to my armed forces were given by me during a meeting.”

He added that Turkey’s policy towards interloping foreign aircraft “had been explained at the highest level. We gave all necessary warnings. We told the Russians that military aircraft may be attacked.”

The incident has caused the worst deterioration of Russian-Turkish relations in decades. Moscow accused the Turkish government of staging a premeditated provocation.

Aggravating the rift is the death of two Russian troops in the incident. The pilot of the downed jet was gunned down by fighters of a Turkey-supported militant group as he was parachuting to the ground. And a marine was killed when a Russian helicopter sent to rescue the crew came under fire from the ground. The helicopter was damaged and forced to land, after which the abandoned aircraft was destroyed by an anti-tank missile.

Davutoğlu blasted Russian anti-terrorist operations in northern Syria, saying Russian airstrikes target civilians not terrorists.

“There are no terrorists there. Airstrikes in Bayırbucak cannot be justified by the fight against IS. We cannot turn a blind eye on the fact that civilians come under attack under the guise of fighting against IS. These attacks must be stopped,” he said referring to the terrorist group Islamic State, which Ankara claims to be fighting against as part of a US-led coalition.

Russia insists there is a presence of foreign jihadist fighters in the region as well as elements of terrorist infrastructure. Moscow believes Ankara is shielding terrorist forces in Syria with the goal of continuing to smuggle oil across the border.

“Turkey’s actions are de facto protection of Islamic State,” Russian Prime Minister Dmitry Medvedev said on Wednesday.“This is no surprise, considering the information we have about the direct financial interest of some Turkish officials relating to the supply of oil products refined by plants controlled by ISIS.”

The Turkish PM said Ankara wants to maintain ties with Russia despite the incident.