Iraq appealed to the United Nations Security Council on Friday to demand an immediate and unconditional withdrawal of all Turkish troops from northern Iraq, calling Turkey's military incursion a "flagrant violation" of international law.

"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 U.S. Ambassador to the United Nations Samantha Power, president of the Security Council this month.

"This is considered a flagrant violation of the principles of the U.N. Charter, and a violation of Iraqi territorial integrity and sovereignty of the state of Iraq," the letter said, according to an unofficial translation of the Arabic original.

The letter, which was seen by Reuters, was sent after Iraqi Prime Minister Haider al-Abadi instructed the Foreign Ministry to lodge a formal complaint at the United Nations.

One diplomat on the 15-nation Security Council said on condition of anonymity that there were no immediate plans to convene a special meeting during the weekend in response to the Iraqi letter.

Turkish President Tayyip Erdogan said on Friday that he would not bow to Iraqi demands to withdraw Turkish troops from a camp close to the Islamic State-held city of Mosul.

Alhakim made clear that bilateral diplomacy had failed so far to end the dispute between the two neighbors.

"Iraq worked on containment of this issue by diplomatic means and bilateral talks, but these efforts did not succeed in convincing Turkey to withdraw its occupying forces from Iraqi territory," Alhakim wrote to Power, noting that the Turkish incursion was an "aggressive act."

He added: "Assistance with military training and advanced technology and weapons to fight the Islamic State terrorist entity must be based upon bilateral and multilateral agreements and in full respect of the national sovereignty and Iraqi constitution, and in coordination with the Iraqi armed forces."

The dispute over the deployment has soured relations between Ankara and Baghdad, which denies having agreed to it. Ankara says the troops were sent as part of an international mission to train and equip Iraqi forces to fight Islamic State, which has seized large parts of Syria and Iraq.

The Turkish military is helping to train local Iraqi volunteers and Kurdish peshmerga who are preparing for a long-anticipated offensive to retake Mosul, a major northern city seized by Islamic State more than a year ago.