Patrick Cockburn is the author of The Rise of Islamic State: ISIS and the New Sunni Revolution

Mosul has been a dangerous place since the US-led invasion of 2003. It is the greatest Sunni Arab city of Iraq during an era in which the Sunni had lost their old predominance and have struggled against Shia-dominated governments in Baghdad and Kurdish rulers next door in Iraqi Kurdistan.

It is a battle that is still going on as the Iraqi army and Shia paramilitaries advance on Mosul from the south while Kurdish Peshmrga come from the east. The way is cleared for both by air strikes, predominantly by the US air force, attacking Isis fighters dug into ruined villages and hiding in deep tunnels.

If the anti-Isis forces ultimately succeed in recapturing Mosul it will be the fifth time the city has changed hands in the course of 13 years of war. The first time was in April 2003 when the Iraqi army was breaking up and surrendering and the Kurdish Peshmerga burst into the city. There was looting on a mass scale which the Arabs blamed on the Kurds and vice versa, but in fact both took part. I saw crowds ransack the governor’s mansion, the Central Bank and the university.

The Arabs, three-quarters of the city’s population of two million, were appalled by the Kurdish incursion. I visited the biggest hospital in Mosul where the director Dr Ayad Ramadani told me that “the Kurdish militias are looting the city. Today the main protection is from civilians organised by the mosques.” By the entrance to the hospital, a family was loading the body of a deceased relative into the back of a truck when there was a burst of machine gun fire. This frightened the truck driver who sped away leaving the body behind and the family angrily waving their fists after him.

Relations between Arabs and Kurds did not get much better over the following years. The Kurdistan Regional Government (KRG) claimed parts of Nineveh province around Mosul which it said had a Kurdish majority or had historically belonged to the Kurds. Mosul sits at the heart of a fascinating but confusing ethnic and sectarian mosaic made up of Arabs, Kurds, Shabak, Yazidis and Christians of different dominations. Few of these communities had any liking for the others.

The Kurdish takeover was followed by the Americans and for the rest of 2003 General David Patraeus commanded the 101st Airborne Division in the city. He could see how the “de-Baathification” campaign mandated by the US authorities in Baghdad was alienating former Iraqi army officers and officials who were now out of a job. A high proportion of the army officer corps had always come from Mosul and, in keeping with this military tradition, the defence minister under Saddam Hussein was from the city. Petraeus issued de-Baathification certificates on his own authority so these unemployed officers were at least eligible for a job.

It was not enough. The Americans over-confidently thinned out their troops and then withdrew the remainder to take part in the recapture of Fallujah. In November 2004, Iraqi armed opposition fighters raced into the city, the newly reformed Iraqi army fled and the rebels captured aresnals of weapons. They withdrew after a few days and Baghdad, backed by the US, regained a shaky control.

But Baghdad’s rule was always contested between 2004 and 2014. There were repeated guerrilla attacks. I would travel from Irbil in KRG to visit the Kurdish deputy governor whose well-fortified office was on the far side of the Tigris river. But we either had to drive very fast or go more slowly in convoys defended by troops and armoured vehicles.

Al-Qaeda in Iraq never entirely lost its grip on Mosul even when it was at its lowest ebb before 2011. Local businesses had to pay it protection money, close down or risk assassination. A Turkish businessman with several big construction contracts there recalled later that he had to pay $500,000 (£400,000) a month and, when this was increased and he refused to pay up, one of his employees was killed. He stopped work, withdrew his staff to Turkey and complained to the government in Baghdad. But their only proposal was that he pay the protection money and add the sum to his contract price.

The government was much disliked in Mosul, but even so the Isis capture of the city in June 2014 was an astonishing victory of a few thousand fighters against a garrison that was meant to total 60,000 and may have had as many as 20,000 soldiers and police. The difference between the two figures was made up of “ghost soldiers” who did not exist or never came to the barracks but whose salaries were taken by officers. Many other soldiers had simply gone on leave to Baghdad and never come back as the security situation deteriorated. When Isis attacked the army and police dissolved.

Isis was never popular in Mosul but they ferociously suppressed all dissent. They drove out the Christians and murdered and enslaved the Yazidis. They blew up iconic monuments like Jonah’s Tomb. People may have disliked them, but there was not much they could do about it.

ISIS also benefited from fear among Sunni in the city about what would happen if the Iraqi army and Shia paramiltary militias came back. They know that the whole five or six million Sunni Arab population of Iraq, a fifth of the 33 million population, are under threat and as many as a third have been displaced. In the sectarian war in Baghdad in 2006-7 the Sunni in Iraq had been driven into several enclaves, mostly in the west side of the city, which US diplomats described as “islands of fear”. This is now happening in the rest of Iraq. Other Iraqis may see them as complicit in Isis’s crimes and seek vengeance. Whatever conciliatory statements come from Iraqi leaders, sectarian and ethnic hatreds are running deep and people in Mosul face a frightening and uncertain future.

Patrick Cockburn is the author of The Rise of Islamic State: ISIS and the New Sunni Revolution

Mosul has been a dangerous place since the US-led invasion of 2003. It is the greatest Sunni Arab city of Iraq during an era in which the Sunni had lost their old predominance and have struggled against Shia-dominated governments in Baghdad and Kurdish rulers next door in Iraqi Kurdistan.

It is a battle that is still going on as the Iraqi army and Shia paramilitaries advance on Mosul from the south while Kurdish Peshmrga come from the east. The way is cleared for both by air strikes, predominantly by the US air force, attacking Isis fighters dug into ruined villages and hiding in deep tunnels.

If the anti-Isis forces ultimately succeed in recapturing Mosul it will be the fifth time the city has changed hands in the course of 13 years of war. The first time was in April 2003 when the Iraqi army was breaking up and surrendering and the Kurdish Peshmerga burst into the city. There was looting on a mass scale which the Arabs blamed on the Kurds and vice versa, but in fact both took part. I saw crowds ransack the governor’s mansion, the Central Bank and the university.

The Arabs, three-quarters of the city’s population of two million, were appalled by the Kurdish incursion. I visited the biggest hospital in Mosul where the director Dr Ayad Ramadani told me that “the Kurdish militias are looting the city. Today the main protection is from civilians organised by the mosques.” By the entrance to the hospital, a family was loading the body of a deceased relative into the back of a truck when there was a burst of machine gun fire. This frightened the truck driver who sped away leaving the body behind and the family angrily waving their fists after him.

Relations between Arabs and Kurds did not get much better over the following years. The Kurdistan Regional Government (KRG) claimed parts of Nineveh province around Mosul which it said had a Kurdish majority or had historically belonged to the Kurds. Mosul sits at the heart of a fascinating but confusing ethnic and sectarian mosaic made up of Arabs, Kurds, Shabak, Yazidis and Christians of different dominations. Few of these communities had any liking for the others.

The Kurdish takeover was followed by the Americans and for the rest of 2003 General David Patraeus commanded the 101st Airborne Division in the city. He could see how the “de-Baathification” campaign mandated by the US authorities in Baghdad was alienating former Iraqi army officers and officials who were now out of a job. A high proportion of the army officer corps had always come from Mosul and, in keeping with this military tradition, the defence minister under Saddam Hussein was from the city. Petraeus issued de-Baathification certificates on his own authority so these unemployed officers were at least eligible for a job.

It was not enough. The Americans over-confidently thinned out their troops and then withdrew the remainder to take part in the recapture of Fallujah. In November 2004, Iraqi armed opposition fighters raced into the city, the newly reformed Iraqi army fled and the rebels captured aresnals of weapons. They withdrew after a few days and Baghdad, backed by the US, regained a shaky control.

But Baghdad’s rule was always contested between 2004 and 2014. There were repeated guerrilla attacks. I would travel from Irbil in KRG to visit the Kurdish deputy governor whose well-fortified office was on the far side of the Tigris river. But we either had to drive very fast or go more slowly in convoys defended by troops and armoured vehicles.

Al-Qaeda in Iraq never entirely lost its grip on Mosul even when it was at its lowest ebb before 2011. Local businesses had to pay it protection money, close down or risk assassination. A Turkish businessman with several big construction contracts there recalled later that he had to pay $500,000 (£400,000) a month and, when this was increased and he refused to pay up, one of his employees was killed. He stopped work, withdrew his staff to Turkey and complained to the government in Baghdad. But their only proposal was that he pay the protection money and add the sum to his contract price.

The government was much disliked in Mosul, but even so the Isis capture of the city in June 2014 was an astonishing victory of a few thousand fighters against a garrison that was meant to total 60,000 and may have had as many as 20,000 soldiers and police. The difference between the two figures was made up of “ghost soldiers” who did not exist or never came to the barracks but whose salaries were taken by officers. Many other soldiers had simply gone on leave to Baghdad and never come back as the security situation deteriorated. When Isis attacked the army and police dissolved.

Isis was never popular in Mosul but they ferociously suppressed all dissent. They drove out the Christians and murdered and enslaved the Yazidis. They blew up iconic monuments like Jonah’s Tomb. People may have disliked them, but there was not much they could do about it.

ISIS also benefited from fear among Sunni in the city about what would happen if the Iraqi army and Shia paramiltary militias came back. They know that the whole five or six million Sunni Arab population of Iraq, a fifth of the 33 million population, are under threat and as many as a third have been displaced. In the sectarian war in Baghdad in 2006-7 the Sunni in Iraq had been driven into several enclaves, mostly in the west side of the city, which US diplomats described as “islands of fear”. This is now happening in the rest of Iraq. Other Iraqis may see them as complicit in Isis’s crimes and seek vengeance. Whatever conciliatory statements come from Iraqi leaders, sectarian and ethnic hatreds are running deep and people in Mosul face a frightening and uncertain future.