Kirkuk is an ethnically mixed oil-rich province of Kurds, Sunni and Shiite Arabs, and Turkmen. It has long been at the center of disputes between Baghdad and the autonomous Kurdistan Regional Government (KRG).
The central government controlled Kirkuk until 2014, when the Iraqi army crumbled as the "Islamic State" (IS) swept through large parts of Iraq and Syria. Kurdish forces moved in to fill the security gap left by the Iraqi army, taking Kirkuk city and parts of the province to prevent their capture by IS.
Read more: The Middle East's complex Kurdish landscape
However, with IS losing much of the territory it gained during its 2014 military assault, tensions over future control of the oil-rich province have re-emerged.
The Kurds held a non-binding independence referendum on September 25, seen by Baghdad as a power grab. Controversially, the vote also included so-called disputed areas outside the KRG's official boundaries, including Kirkuk.
The referendum passed with more than 90 percent support.Baghdad viewed the referendum as unconstitutional and has vowed to reassert control over disputed territories, with Kirkuk at the center of the dispute.
Following the referendum, Iraq's parliament demanded the military be deployed to Kirkuk to reassert control. However, Iraqi Prime Minister Haider Abadi said he would accept a "joint administration" with the Kurds in the province before hostilities escalated.
The US, UN and EU had voiced concerns about the vote, while Turkey and Iran threatened to close their land borders with the Kurdistan region over the referendum.
What forces are involved?
The situation in Kirkuk has long been described by analysts as a potential powder keg, while the risk of civil war between Baghdad and the Kurds has witnessed a notable increase in the wake of the referendum.
The Kurds and Baghdad were united in fighting IS, but as that threat retreats following sustained battlefield losses, long simmering issues between the two sides have come to the fore. On one side is the Iraqi army and allied Iranian-backed Shiite militia, known as the Popular Mobilization Units (PMU), and on the other side the Kurdish peshmerga.
The peshmerga are, in turn, divided between two parties, the Patriotic Union of Kurdistan (PUK) and Kurdish President Masoud Barzani's Kurdistan Democratic Party (KDP). The PUK controlled Kirkuk, but KDP-tied peshmerga controlled three of the provinces five oil fields.
The PUK and KDP are rivals and the current crisis in Kirkuk has highlighted disunity between Kurdish factions and renewed fears of an intra-Kurdish conflict.
The US has trained and supplied weapons to both the Iraqi army and peshmerga to fight IS, putting Washington in a difficult position in the current standoff. The role of the PMU, supported by Iran's Islamic Revolution Guard Corp, is a complicating factor as US President Donald Trump has vowed to push back against Iran's "destabilizing” activities in the Middle East.
The Kurdistan Workers' Party (PKK), which has fought a more-than-three-decade-long insurgency against Turkey, also has forces deployed in Kirkuk in support of the PUK. The PKK presence is sure to draw the ire of Turkey, which supports its ethnic cousins the Turkmen. For years, Turkey has notably described a unilateral move by the Kurds to control Kirkuk as a red line.
Kirkuk's ethnic and religious mixture are a microcosm of Iraq's sectarian divide itself – sitting on top of Iraq's second largest oil reserves. Kirkuk province underwent "Arabization" under former Iraqi dictator Saddam Hussein's Ba'ath Party, shifting the demographic balance of the province that was once majority Kurdish.
Read more: Turkey's anti-Kurdish crackdown continues
Since the 2003 US invasion of Iraq, Kurds have sought to tip the demographics of the province back in their favor. Under article 140 of Iraqi's constitution, Kirkuk was supposed to hold a referendum on its status but the vote has been repeatedly delayed.
Kurdish claims are based off the 1957 Iraqi census, the last held in the province, which showed Kurds to be a majority in Kirkuk province, although the Turkmen and Arabs could claim a majority in Kirkuk city proper. However, it is believed that the Kurds are now a majority in both the province and the city.
For the Kurds, control of Kirkuk would help underpin political independence through economic control of the province's oil and gas resources. The Kurds export an average of 600,000 barrels of oil per day through Turkey and a lesser extent Iran, of which 250,000 bpd come from the three fields they controlled in Kirkuk province. The Iraqi government retook Kirkuk and the oil-fields on October 16, dealing a blow to the Kurds' already precarious financial situation.
Before 2014, the Iraqi government extracted and exported oil from Kirkuk's fields. The Kurds controlled three of five oil fields that have the capacity to pump a million barrels a day.
Baghdad and the Kurds have long-running disputes over oil exports, extraction and sharing oil revenues. Under the Iraq's constitution, the Kurds are supposed to receive 17 percent of Iraq's oil revenues. However, Kurdish politicians often complain they do not receive their fair share.