Turkey said it had deployed a force protection unit earlier this month to the area due to heightened security risks near a camp where its troops were training an Iraqi militia to fight Islamic State insurgents. Ankara acknowledged that there had been a "miscommunication" with Baghdad over the deployment.
Iraqi security forces have had only a limited presence in Nineveh province where the camp is located since collapsing in June 2014 in the face of a lightning advance by Islamic State.
Foreign Minister Ibrahim al Jaafari said Iraq was committed to exhausting peaceful diplomatic avenues to avoid a crisis with its northern neighbour Turkey, but insisted that all options remained open.
"If there is no other solution but this (military), then we will adopt this solution. If we are forced to fight and defend our sovereignty and riches, we will be forced to fight," he told reporters in Baghdad.
Iraq PM vows to defeat Islamic State in 2016 after army's first major victory
Turkey's deployment of around 150 troops this month to the Bashiqa military base in northern Iraq prompted Baghdad to accuse Ankara of violating its sovereignty and lodge a formal complaint at the UN Security Council.
Turkey later withdrew some troops to another base inside the nearby autonomous Kurdistan region and said it would continue to pull out of Nineveh province, where Bashiqa is located. It did not say how many troops would be moved or where to.
After the diplomatic dispute flared, the base came under fire from Islamic State when militants fired rockets in an attack on Kurdish Peshmerga forces in the area. The Turkish military said its soldiers returned fire and four had been lightly wounded in the incident.
Baghdad's forces have regrouped and retrained with US help since the debacle at the hands of Islamic State 18 months ago and on Sunday retook the western provincial capital of Ramadi, their first big victory against the ultra-hardline militants.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ