Thousands of Iraqi troops were locked in an armed standoff with Kurdish forces in the disputed oil province of Kirkuk on Saturday as Washington scrambled to avert fighting between the key allies in the war against the Islamic State (IS) group.
The clock was ticking down to a 2 am Sunday (2300 GMT Saturday) deadline that the Kurds say Baghdad has set for their forces to surrender positions they took during the fightback against IS over the past three years.
Armoured cars of the Iraqi army bearing the national flag were posted on the bank of a river on the southern outskirts of the city of Kirkuk, an AFP photographer reported.
On the opposite bank, Kurdish peshmerga fighters were visible behind an earthen embankment topped with concrete blocks painted with the red, white green and yellow of the Kurdish flag.
"Our forces are not moving and are now waiting for orders from the general staff," an Iraqi army officer told AFP, asking not to be identified.
The two sides have been at loggerheads since the Kurds voted overwhelmingly for independence in a September 25 referendum that Baghdad rejected as illegal.
Polling was held not only in the three provinces of the autonomous Kurdish region but also in adjacent Kurdish-held areas, including Kirkuk.
Iraqi Prime Minister Haider al-Abadi has said there can be no further discussion of the Kurds' longstanding demands to incorporate Kirkuk and other historically Kurdish-majority areas in their autonomous region until the independence vote is annulled.
He insisted on Thursday that he was "not going... to make war on our Kurdish citizens".
But thousands of heavily armed troops and members of the Popular Mobilisation Force (PMF) -- paramilitary units largely made up of Iran-trained Shiite militias -- have massed around Kirkuk.
They have already retaken a string of positions to the south of the city after Kurdish forces withdrew.
The Kurds have deployed thousands of peshmerga fighters to the area around Kirkuk itself and have vowed to defend the city "at any cost."
Just hours before the deadline, a peshmerga commander on the western front said Kurdish fighters had "taken all the necessary measures" and were "ready for a confrontation" if necessary.
If "the other side makes the mistake of advancing, we'll give them a lesson they won't forget in a hurry", Kamal Kirkuki said.
So far the front lines have been quiet but the Kurds said they had received an ultimatum to withdraw.
"The deadline set for the peshmerga to return to their pre-June 6, 2014 positions will expire during the night," a senior Kurdish official told AFP, asking not to be identified.
Asked at what time, he said 2 am on Sunday (2300 GMT Saturday).
The official's comments came as Iraqi President Fuad Masum, who is himself a Kurd, was holding crisis talks in the Kurdish city of Sulaimaniyah.
The June 2014 lines are those that the Kurds held before IS militants swept through vast areas north and west of Baghdad, prompting many Iraqi army units to disintegrate and Kurdish forces to step in.
The Kurds control the city of Kirkuk and three major oil fields in the province which account for a significant share of the regional government's oil revenues.
Washington has military advisers deployed with both sides in the standoff and Defence Secretary Jim Mattis said on Friday that it was working to reduce tensions.
"We are trying to tone everything down and to figure out how we go forward without losing sight of the enemy," Mattis told reporters.
"Everybody stay focused on defeating ISIS. We can't turn on each other right now. We don't want to go to a shooting situation," he added, using an alternative acronym for IS.
Last week, the Iraqi army retook the Sunni Arab insurgent bastion of Hawija, the last town in Kirkuk province in IS hands, but there has been fighting in the countryside since.
The tensions between the Kurds and the Shiite militias in Kirkuk have spilled over into sporadic violence elsewhere in Iraq.
In the mainly Shiite Turkmen town of Tuz Khurmatu in neighbouring Salaheddin province, three PMF paramilitaries and two Kurdish peshmerga were wounded in a firefight overnight, town council spokesman Shalal Abdul said.
In the mainly Shiite city of Hilla, south of Baghdad, the offices of a Kurdish-owned mobile phone company were firebombed and three of its staff briefly abducted, police said.