KIRKUK, Iraq - On the streets of Kirkuk, a heavy security presence is keeping a lid on terrorism attacks tearing apart other areas of Iraq, but a palpable sense of tension remains.

Uniformed men are stationed at almost every junction, traffic slows at checkpoints and flows past blast walls protecting police stations and public buildings. The busy roads contrast with empty pavements lined with run-down houses and shabby convenience stores.

On the city's rim, the Kurdish Peshmerga have established themselves in bases once housing the Iraqi army, feeding men and material into the front lines holding the Islamic State (IS) group at arms length.

Cut loose from Baghdad's control, subject to competing claims, and eyeing autonomy, few cities embody the creeping disintegration and uncertain future of Iraq better than oil-rich but decaying Kirkuk.

The city and wider province is part of the so-called disputed territories that Kurdish troops were able to occupy when the Iraqi army collapsed under the IS onslaught in 2014.

These territorial gains and the weakness of the government in Baghdad emboldened the Kurdistan Regional Government (KRG) in its quest for an independent state. It is the stated objective of long-time President Massoud Barzani, who has called for a referendum on Kurdish independence to be held this year.

For Kirkuk's governor Najmaldin Karim, this represents a chance to force a decision on the city's future. But a referendum on whether Kirkuk should become part of the KRG, outlined in Iraq's constitution, has failed to get off the ground, and the governor believes that the two mooted votes should be merged.

"If there is a referendum for Kurdistan, that should include Kirkuk as well," Karim tells Middle East Eye during an interview in his heavily guarded compound in the city centre.

After the fall of Saddam Hussein in 2003, the city became part of the territories claimed by both the KRG and the central government in Baghdad, which straddle the autonomous Kurdish region and stretch from the Iranian to the Syrian border.

Sometimes referred to as the "Kurdish Jerusalem," the city is integral to Kurdish nationalism and a central plank in secessionist aspirations.

Children at a school in Kirkuk, which has been spared the worst of the war against IS (AFP)

Karim is quick to downplay suggestions that a break up of Iraq is imminent. He doubts whether the referendum will be held this year, but is adamant that the disputed territories need to be part of it, as it would otherwise "exclude 40 percent of Kurdistan".

"In that case it's a useless referendum," said Karim.

The governor does not hide his frustration with the Iraqi government.

"We have a lot of grievances with Baghdad. It’s a strong, centralised and inefficient, incompetent administration. Baghdad is very controlling, and the constitution says Iraq should be federal," said Karim.

Local autonomy features highly on the governor's list of priorities, not least as a way to assure the diverse population of the city.

"Even if Kirkuk becomes part of KRG, it has to have a special status within the KRG, because Kirkuk is multi-ethnic, multi-sect, multi-religion," he said.

Kirkuk's demographic composition is hotly debated and difficult to assess, as previous censuses under the Saddam regime are thought to be politically motivated.

Based on his reading of statistics from Iraq's parliamentary elections in 2010 and 2014, Karim believes that Kurds make up between 53-55 percent of Kirkuk's population, while Arabs and Turkmen contribute around 33 percent and 14 percent respectively.

"If Kirkuk was to become part of the KRG there is no doubt that locals would want Kirkuk to be treated in a different manner to Sulimani, Erbil, Dohuk and Halabja," said Sam Morris, an analyst at the Middle East Research Institute.

Mass influx of refugees

As part of his Arabisation efforts of Kurdish territories, Saddam Hussein changed demographics by resettling Arabs from the south to Kirkuk, and redrawing the borders of the governorate, excluding Kurdish and adding Arab areas.

The spread of IS has also led to a huge wave of displacement, with millions fleeing areas occupied by the group.

Kirkuk took about 600,000 refugees, mainly Sunni Arabs from the Hawija and Salaheddin provinces to the south of the city.

Less than 50,000 have returned since IS was expelled from parts of those provinces, said Karim.

Weary of a creeping Arabisation of Kirkuk, Karim insists that the refugees will have to leave the city as soon as it is safe for them to do so.

"We are not going to allow demographic changes. They have to go back, these people are not from Kirkuk," he said.

The ethnic mix, typical of the disputed territories, requires a transition period even if the city would eventually join the Kurdish region.

"Initially it would be difficult to be part of the KRG, as you need some consensus and that's not available," said Karim.

"[We need a] transition before we become part of the KRG, three or four years to administer Kirkuk by itself. When people see that, they can make a better judgment by themselves: do they want to keep that or do they want to join the KRG?"

While a Kurd himself, Karim is not willing to commit too heavily to an eventual union with the KRG or a future Kurdish state. Instead, he is keeping his options open, keen to get the best possible deal for the province.

"We may go for our own region ourselves," he said in a warning to both Erbil, the KRG's capital, and Baghdad.

Oil draws Kirkuk closer to Kurdish Iraq

But there are signs that Kirkuk is shifting away from Iraq and drawing closer to the Kurdish orbit.

Already protected by Peshmerga, Kirkuk's economic ties with the KRG were strengthened by a deal that remunerates the city for its oil.

The bulk of Kirkuk's oil production - about 325,000 and 350,000 barrels a day according to Karim - is now under Kurdish control and finds its way either to the KRG or to the international markets via a pipeline running through Kurdish territory to the Turkish port of Ceyhan.

Since 2013, Baghdad has not paid $1-a-barrel fee that Kirkuk is entitled to. Under the agreement with the KRG, the city will receive $10mn a month for its oil.

The deal, which was revealed earlier this month, is backdated to June 2015, and payments for January and February have already been made, said Karim.

"KRG’s payments of $10mn a month strengthens its influence in the governorate. Not only are they able to provide security in the form of Peshmerga, they are able to assist economically, areas where the government in Baghdad failed," said Morris.

Peshmerga already protect Kirkuk from IS (AFP)

As much as Kirkuk tries to insulate itself from Baghdad's failings, it is impossible to ignore the war that is still being played out on its doorstep, and IS continues to menace.

On 9 March, IS launched a chemical attack on Taza, a small Shia Turkmen town just behind the Kurdish front, raining down mortar shells filled with poison gas in the latest of such attacks in Iraq.

Hundreds of locals were reportedly treated after inhaling the gas, and a three-year-old girl was killed. IS fired more gas into the town three days later.

Only a few kilometres from Kirkuk lies the Kurdish frontline. Earthen mounds have been thrown up in seemingly endless lines, each topped with defensive fortifications.

A ditch, several metres wide and deep, has been dug in front, its earth formed into an embankment that joins up the forts.

They are manned by about a dozen Peshmerga, armed with heavy machine guns and a generous supply of rocket propelled grenades that can take out suicide bombers driving armoured cars into their lines.

Behind, a huge blast wall is being erected, and has been completed in some sections of the front. A concrete barrier stretching out across the flat farmland resembles a misplaced Berlin Wall.

IS has found these defences near impossible to breach. So too will the Iraqi army and its allied Shia militias should they try and take back Kirkuk by force once the IS threat has been banished.