Turkey will not withdraw troops from an Iraqi camp close to the northern ISIS-controlled city of Mosul, said President Tayyip Erdogan, condemning Iraq’s appeal to the UN Security Council about Turkish forces’ presence, which deemed it to be “not honest.”

“They can resort to the UN Security Council, that is their natural right, but this is not an honest step and we believe that Iraq’s actions are related to the latest developments in the region, that is, the steps taken by Russia and Iran,” Erdogan said in an interview with Al Jazeera.

Erdogan's comments came shortly before Iraq sent a letter to the UN Security Council demanding an immediate and unconditional withdrawal of all Turkish troops from Iraq.

“We call on the Security Council to demand that Turkey withdraw its forces immediately ... and not to violate Iraqi sovereignty again,” Iraqi Ambassador Mohamed Ali Alhakim said in a letter to US Ambassador to the United Nations Samantha Power, who is currently the president of the Security Council’s rotating seat.

"This is considered a flagrant violation of the principles of the UN Charter, and a violation of Iraqi territorial integrity and sovereignty of the state of Iraq," the letter said, according to Reuters.

The Iraqi envoy send the letter following Iraqi Prime Minister Haider Al Abadi’s instructions which had been given earlier on Friday. In its plea to the UNSC, the Iraqi side stated that bilateral diplomacy had failed to work to resolve the crisis against an "aggressive act."

He stressed that any assistance with military training to fight IS must be based on “bilateral and multilateral agreements” and with respect to Iraqi sovereignty, as well as in "coordination with the Iraqi armed forces."

Taking to Twitter, the Iraqi Prime Minister reiterated that Turkey's actions constitute a “flagrant violation of sovereignty.” At the same time, Abadi said that it is the “constitutional and national duty to protect the country and defend its security and sovereignty and territorial integrity.” The PM promised to take “all measures” and resort to “all legitimate means” to protect Iraq.

Earlier in the day Erdogan once again said he will not withdraw his troops, blaming Iraq for not taking the proper steps to protect its neighbor against the terrorist threat from Islamic State (IS, formerly ISIS/ISIL).

“Because Iraq is a place where terrorist organizations are running wild, especially Daesh [IS] … these terrorist organizations are a threat element for Turkey,” Erdogan said early Friday morning as he left on a visit to Turkmenistan.

“If the Iraqi central government does not take the necessary measures against possible threats to Turkey, we have to do it ourselves,” he added, reported Turkey’s Anadolu Agency.

The Turkish leader maintains that the Turkish presence was established at the end of 2014 for a training mission at the request of the Iraqi prime minister.

“Now it has been approximately a year-and-a half since the establishment of the Bashiqa camp. One would ask: where were you a year-and-a-half ago?” Erdogan asked.

Baghdad however keeps on reminding Ankara daily that the latest deployment of some 150 soldiers and a few dozen tanks was done without the permission or consent of from Iraq. Iraqi MPs told RT that Erdogan’s justification of the deployment is an “absolute lie” as it comes in an area where no Iraqi troops are present.

Iraq has also repeated that it wants to resolve the tension peacefully through negotiations and diplomatic means. On Thursday the Iraqi capital welcomed a Turkish delegation, including its head of intelligence Hakan Fidan.

“The Turkish delegation was told that the only way to resolve the crisis is the full withdrawal of Turkish troops from Iraqi territory, and this will open the way for positive relation[s],” Thursday's statement from the Iraqi PM said.

The results from that meeting were reported to Erdogan and Turkish Prime Minister Ahmet Davutoglu.

“Taking into account the Iraqi government’s sensitivity, the decision was taken to reorganise the military personnel in the protection force at the Bashiqa camp,” Davutoglu’s office said in a statement.

After considering the Iraqi offer, Erdogan refused to withdraw his forces

“At the moment retreating our troops is out of question. [...] [It] is not about keeping combat troops but a backup to protect our officers providing training there. All the numbers that have been released [regarding Turkish troops] are extreme. These numbers do not have any relation, close or far, with the number of soldiers we deployed,” Erdogan said Friday.