It’s the most dangerous of brinkmanship and the stakes could not be higher. While not yet making the headlines it deserves, late Friday night after eleventh-hour negotiations between Kurdish and Iraqi government officials, Iraq seemed to step back from the brink of civil war - for now.

“Had the Iraqi forces kept moving for another 15 minutes, they would have hit the first red line, you could say, and would have been fired upon,” says Michael Knights, a senior fellow at the Washington Institute for Near East Policy.

The analyst was describing how Kurdish and Iraqi government forces after rushing troops and armour to the oil-rich city of Kirkuk, found themselves squaring off on Friday, sending political jitters across the region and beyond.

“We can’t turn on each other right now. We don’t want this to go to a shooting situation,” insisted US Defence Secretary Jim Mattis.

Mattis was referring to the alliance between Iraqi and Kurdish forces that until recently has seen them fight jointly to rout the jihadists of the Islamic State (IS) group from Iraq, but which now finds the two sides pitched against each other in a dangerous stand-off.

Mattis went on to stress that tensions between Kurdish and Iraqi forces in and around Kirkuk had the full attention of the United States, which was working to ensure the situation didn’t escalate.

Despite these American assurances though, the situation remains on a knife-edge. According to some reports yesterday, Iraq’s Prime Minister Haider al-Abadi and other officials have given a 48-hour deadline to the Kurdish authorities to give up Kirkuk to make room for talks.

Reports from the Kurdish news service Rudaw, say Baghdad delivered a message with six demands that include the handing over of Kirkuk airport, a major military base, all oil fields and all IS militants held by the Peshmerga.

The Kurdish authorities must also allow the return of the Iraqi Army to all places where they were previously stationed in 2014 and the removal of Kirkuk’s Kurdish Governor Najm al-Din Karim from his position.

Baghdad gave the Patriotic Union of Kurdistan (PUK) the dominant Kurdish party in Kirkuk, a deadline of 2 am Sunday morning (today) to fulfil the six demands, with the implication that military action could follow if they were not met.

The tensions resulting from Baghdad’s ultimatum were further exacerbated yesterday by reports of clashes just south of Kirkuk between Kurdish Peshmerga forces and the Shi’ite militia group Hashd al-Shaabi that fights alongside the Iraqi Army.

The exchanges of mortar and gunfire took place near the city of Tuz Khurmatu, about 48 miles south of Kirkuk. The city is strategically important, and most likely the location from which Iraqi government forces and Shi’ite militias would launch any all out military operation to take Kirkuk city and province from the Kurds.

This latest and potentially disastrous crisis in Iraq comes barely a few weeks after Iraqi Kurds voted for independence from Baghdad.

In what proved to be a contentious referendum, the Iraqi government along with regional neighbours Turkey and Iran who both have sizeable Kurdish minorities of their own, vigorously opposed the ballot.

Similarly much of the international community was against the Kurdistan Regional Government’s (KRG) decision to go ahead with the vote, including the US, UK, EU and UN.

Since the referendum result in which more than 92 per cent of those who cast their ballot voted “yes” to independence, the Baghdad central government has taken a series of steps to isolate the autonomous Kurdish region. This has included the closing of international airspace and the banning of international flights from going there.

Far and away though oil rich Kirkuk remains the biggest bone of contention between the two sides. With a population of more than one million people, Kirkuk lies just outside KRG territory, but Peshmerga forces were compelled to deploy there in 2014 after Iraqi security forces collapsed in the face of an onslaught by the Islamic State (IS) that threatened to result in the oilfields falling into jihadist hands.

A little more than a fortnight ago on referendum day, the Kurdish Governor of Kirkuk, Najm al-Din Karim, who now finds himself in the eye of the storm, spoke to The Sunday Herald at his heavily fortified residence in Kirkuk, outlining his hopes and fears for the city.

“There have been anxious moments, but we felt very strongly that Kirkuk had to be included in the referendum,” Karim said.

He also acknowledged the fears of many “who had come to believe” the vote would lead to unrest in Kirkuk and violence across Iraq.

Insisting that the sectarianism “that killed Iraq” in 2003 no longer existed in Kirkuk, he spoke of how since then, “Kurds, Arabs, Turkmen, Shi’ites, Sunnis, have been living side by side in this city.”

“It’s the people from outside who make these grand pronouncements about how dangerous Kirkuk is, that it’s a timebomb or tinderbox and they have been saying this since 2003 and they have been proven wrong,” Karim insisted.

Yet barely three weeks since his remarks, Kirkuk sits on the frontline of what could prove to be another catastrophic conflict for Iraq.

It was late last Thursday that the KRG’s Security Council began to express alarm at what it called a significant Iraqi military build-up south of Kirkuk that included tanks, artillery, Humvees and mortars.

“These forces are approximately three kilometres from Peshmerga forces, and intelligence show intentions to take over nearby oilfields, airport and military base,” it said in a statement.

In response an Iraqi military spokesman said the military movements near Kirkuk aimed only to “inspect and secure” the nearby city and surrounding region of Hawija, that was recaptured from IS a week ago marking a virtual end to the jihadists territorial caliphate in Iraq.

Kurdish security sources later said that the Peshmerga had shifted their defence lines by 1.9 miles to 6 miles south of Kirkuk to reduce the risk of clashes with Iraqi forces, with Shi’ite militias then moving into some of the vacated positions.

The area from which the Peshmerga withdrew is populated mainly by Shi'ite Muslim Turkmen, many of who are loyal to the Shi'ite led-government in Baghdad and affiliated with Iranian-backed political parties and paramilitary groups.

An Iraqi military spokesman said troop movements near Kirkuk aimed only to “inspect and secure” the nearby region of Hawija recaptured from Islamic State militants a week ago.

Jafar Shakhe Mustafa, the commander of Kurdish forces in Kirkuk, said that the withdrawals were intended to avoid conflict with Iraqi forces, “who stood with us in fighting Daesh,” the commonly used Arabic acronym for IS.

But commander Mustafa was adamant that Kurdish forces would stand their ground adding when it came to the bigger prize of Kirkuk: “We promise the people of Kirkuk that we will defend them until the last drop of our blood against any attack on the city.”

For some time now the threat of confrontation between Iraqi and Kurdish forces has grown as their common enemy over the past years, IS, has been on the back foot. The jihadists last territory in Iraq is now a stretch skirting the western border with Syria following the fall of the town of Hawija and surrounding areas on October 5 in an offensive by Iraqi forces backed by the US.

But just as the territory controlled by IS has shrunk, so the ethnic and sectarian fractures that have plagued Iraq for more than a decade have once again started to resurface.

The recent independence referendum and its result only added to the strain between Baghdad and the KRG in its de-facto capital of Erbil.

Other regional players also opposed to Kurdish statehood aspirations have, of course, been making their presence felt, notably Iran and Turkey.

Iran remains heavily involved in a supporting and directive role with the Shi’ite militias fighting alongside Iraqi troops.

Kurdish officials believe Iranian officers, together with the senior leaders of the Hashd al-Shaabi, or Popular Mobilisation Forces (PMF) as they are some times referred to, are directing movements on the ground.

Kurdish security officers also say they are aware of specific plans to seize districts inside Kirkuk, and that the operation is being directed from near the town of Hawija, the stronghold most recently retaken from IS.

Turkey too is monitoring the situation closely, both in terms of Kirkuk’s Turkmen population and the crucial Kirkuk-Ceyhan oil pipeline that runs to the Turkish border.

As Baghdad’s deadline to the Kurdish authorities expires today, the US has called for calm. “These are issues that are longstanding in some cases. ... We’re going to have to recalibrate and move these back to a way where we solve them politically and work them out with compromised solutions,” insisted US Defence Secretary Jim Mattis.

But whether this crisis can be resolved diplomatically or be forced to play out on the battlefield remains to be seen. For the moment Baghdad is not budging, while the Kurdish position was summed up a few days ago by Hemin Hawrami chief adviser to Kurdish president Masoud Barzani, who warned Baghdad “Do not test our will.”

If there is one thing certain for now in this extremely dangerous situation it’s quite simply that more bloodshed is that last thing Iraq needs.

Kirkuk stand-off: the facts

Kirkuk

Kirkuk is an oil-rich province claimed by both the Kurds and the Iraqi central government. It is thought to have a Kurdish majority, but its provincial capital has large Arab and Turkmen populations. Kurdish Peshmerga forces took control of much of the province in 2014, when Islamic State (IS) jihdists swept across northern Iraq and the army collapsed.

Iraqi Forces

Many of Iraqi army units positioned around Kirkuk have previously been deployed in the retaking of major cities and towns from the jihadists of the Islamic State group. These include armoured divisions and infantry as well as Special Forces units. In the early stages of the campaign to retake Iraq’s second largest city Mosul from IS, the Iraqi Army fought alongside the Kurdish Peshmerga.

Hashd al-Shabi or Popular Mobilisation Forces (PMF)

When the war against the Islamic State began in 2014, Iraq’s security apparatus collapsed, leading many volunteer fighters to join paramilitaries rather than the weakened military or police forces. These substate forces were grouped under an umbrella organisation called the Popular Mobilisation Forces (PMF), or al-Hashd al-Shabi in Arabic. Although the PMF’s size is heavily contested, the group includes over 60,000 fighters and is composed of some 40 militias, which are mainly Shia Muslim groups some with strong links to Iran.

Kurdish forces - Peshmerga

The Peshmerga, whose name translates as, “those who face death” are the military forces of the autonomous region of Iraqi Kurdistan. The overall formal head of the Peshmerga is the president of Iraqi Kurdistan. The Peshmerga force itself is largely divided and controlled separately by two Kurdish political parties the Democratic Party of Kurdistan (KDP) and the Patriotic Union of Kurdistan (PUK)

Main political parties in Iraqi Kurdistan

These are the Patriotic Union of Kurdistan (PUK), and the Democratic Party of Kurdistan (KDP). Tension between the two erupted into a civil war that almost destroyed the autonomous government in 1994-97, and some differences remain.

Leaders

Iraq’s Prime Minister Haider al-Abadi is a veteran politician from the Shia State of Law party. He was prime minister from 2006, and alienated Kurds and Sunnis with his firmly Shia orientation. He failed to hold back the jihadist insurgents after US troops left in 2011, and lost support after Islamic State captured Mosul and moved on central Iraq in the summer of 2014.

Kurdish President Masoud Barzani has been president of Iraqi Kurdistan since his election in 2005. After his latest mandate expired in August 2015 his term in office was extended in a moved described as illegal by the opposition.

Governor of Kirkuk, Najm al-Din Karim was born in Kirkuk in 1949, and lived in Kirkuk until he completed secondary school. Karim became involved in politics at university, being elected to the leadership of the Kurdish Student Union in 1971, and then later joining the Peshmerga in 1972. Kirkuk’s Governorate Council subsequently elected him as governor of Kirkuk on 29 March 2011.