Shia militiamen and Iraqi government forces are preparing to launch a counter-offensive to recapture Ramadi as Isis fighters tighten their control of the city after seizing it in a three-day battle.

The loss of Ramadi has discredited the Baghdad government and US policy of relying on the regular army backed by US air strikes to hold back and ultimately defeat Isis.

The first contingents of Shia paramilitaries from the al-Hashd al-Shaabi (“Popular Mobilisation”) are assembling at Habbaniyah military base 20 miles east of Ramadi. In total the paramilitaries are reported to number between 100,000 and 120,000 men, though only a small number of these are in Anbar province – of which Ramadi is the capital – while the regular army has only a maximum of five brigades or 15,000 soldiers who are effective in combat.

Several of its best units are exhausted or suffered heavy losses in fighting over the last 18 months with many desertions. An Iraqi government statement said that “severe punishment will be done on those who failed to carry out their duties during the Ramadi battle”. Other units are scattered and 28 soldiers were rescued by government helicopters, the men hugging and kissing each other afterwards in their joy at having survived and in the knowledge that Isis seldom takes prisoners.

Left with no option but to deploy the militiamen, the government and the US would like a swift counter-attack to retake Ramadi. But their first priority may be to defend Baghdad and cities like Samara and Kerbala. Meanwhile, the Iraqi government’s notoriously corrupt and incompetent military administration will struggle to feed and supply with ammunition a large number of men in the front line. On the other hand, it will prove difficult for Isis to advance further in the face of sustained American air attack.

Fall of Ramadi Show all 17 1 /17 Fall of Ramadi Fall of Ramadi Fall of Ramadi A displaced Iraqi Sunni man pushes an elderly woman in a wheelchair on the outskirts of Baghdad. Reuters Fall of Ramadi Fall of Ramadi An Iraqi family, who fled the city of Ramadi after it was seized by Islamic State (IS) group militants, gathers inside a tent at a camp housing displaced families. AFP Fall of Ramadi Fall of Ramadi Displaced Iraqis from Ramadi. AP Fall of Ramadi Fall of Ramadi Iraqi fighters of the Shiite militia Asaib Ahl al-Haq (The League of the Righteous) stand guard outside their headquarters AFP Fall of Ramadi Fall of Ramadi Iraqis fleeing from their hometown of Ramadi walk on a street near the Bzebiz bridge, 65 kilometers (40 miles) west of Baghdad. AP Fall of Ramadi Fall of Ramadi Iraqi Sunni tribal leaders demand Prime Minister Haider al-Abadi to send forces to protect their city and regain Ramadi shortly after Iraqi security forces withdraw from the city. AFP Fall of Ramadi Fall of Ramadi Displaced Iraqis from Ramadi rest before crossing the Bzebiz bridge after spending the night walking towards Baghdad. AP Fall of Ramadi Fall of Ramadi Ramadi, after fighting on Friday, was one of the army’s few strongholds Reuters Fall of Ramadi Fall of Ramadi Iraqi security forces withdraw from the Anbar state capital, Ramadi, in defeat on Sunday, 17 May (AP) AP Fall of Ramadi Fall of Ramadi Iraqis fleeing from their hometown of Ramadi walk on a street near the Bzebiz bridge, 65 kilometers (40 miles) west of Baghdad AP Fall of Ramadi Fall of Ramadi 130,000 remaining inhabitants of Ramadi, an overwhelmingly Sunni city, have fled the fighting (AP) AP Fall of Ramadi Fall of Ramadi Thousands of civilians fled the Isis advance in Ramadi AP Fall of Ramadi Fall of Ramadi Iraq security forces were seen fleeing from Ramadi, the capital of Iraq's Anbar province AP Fall of Ramadi Fall of Ramadi Civilian belongings can be seen in an abandoned truck during fighting in Ramadi Reuters Fall of Ramadi Fall of Ramadi Isis led its renewed assault on Ramadi with suicide car bombs on Friday Reuters Fall of Ramadi Fall of Ramadi The last remaining Iraqi security forces defending their headquarters against Isis in the eastern part of Ramadi on 14 May Reuters Fall of Ramadi Fall of Ramadi Civilians fled Ramadi as Isis advanced earlier in May. Reuters

Isis has moved swiftly to secure control and win popularity among the minority of people who have not fled Ramadi by bulldozing concrete blast walls or using cranes to remove them and other fortifications erected by the Iraqi army. These were unpopular because they made it difficult to move around the city.

Isis also released some 70 men and 31 women from Ramadi prison who had been shot in the feet to prevent them escaping by their jailers before they fled. Sunni Arabs in the city had long complained that local police arrested people arbitrarily, tortured them and would only release them after payment of a bribe. Using loudspeakers, Isis told relatives to come to the main mosque to pick up the prisoners.

The militant jihadis have raised their black flag over all public buildings and promised that food, doctors and medicine will be available. But they have also reportedly killed hundreds of members of the local security forces and tribesmen who fought against them.

An Islamic State fighter in the city of Ramadi (EPA)

They have promised to introduce sharia and are already enforcing their extreme conservative social mores. Jasim Mohammed, 49, who owns a women’s clothing shop, told Reuters that an Isis member had told him he must now sell only traditional Islamic garments. “I had to remove the mannequins and replace them with other means of displaying the clothes,” he said. “He told me that I shouldn’t sell underwear because it’s forbidden.”

Even so, the majority of people in Ramadi, which once had a population of 600,000, are fleeing or fled months ago when the struggle for the city started early in 2014. But they are finding it difficult to secure a safe refuge because the security forces in Baghdad 70 miles to the west suspect refugees of being secret members of Isis. They are kept waiting in cars or on foot in daytime temperatures expected to reach 44C. Four people are reported to have died of heat stroke.

The Isis offensives of 2014 and 2015, which either brought Sunnis under the control of the jihadi militants or displaced them from their homes, may turn out to be a long-term disaster for the six million Sunni Arabs of Iraq.

Annas, a journalist from Ramadi whose family has fled, told The Independent: “We Sunni in Iraq are going to end up being forced out of our homes like the Palestinians.” He said it was difficult for a Sunni like him to live in Baghdad which “had become a city of militias”.

There is fear among refugees that Ramadi and the highway linking it to Baghdad will soon be engulfed by fighting. The leaders of the Shia militias such as the Badr Organisation, Asaib Ahl al-Haq and the Hezbollah Brigades (different from the Lebanese movement of the same name) will be eager to show that they can succeed where the state security services failed.

Ever since the mass mobilisation of Shia, heeding the call of the immensely influential Grand Ayatollah Ali al-Sistani on 13 June last year after Isis took Iraq’s second city, Mosul, there has been rivalry between Shia militias and central government over control of security. Some, but not all, of the militias are under the influence of Iran.

The Prime Minister, Haider al-Abadi, has sought to bring the militiamen, who receive a monthly stipend of $750 (£484) from the government, under his authority. Backed by the US, he was seeking to build up the regular security services and had some success at Tikrit, the home town of Saddam Hussein captured by Isis, which had first been attacked by the militias but which they were unable to take. It eventually fell to an assault backed by US air strikes, led by the regular army’s “Golden Division”, and on 1 April Mr Abadi visited Tikrit and claimed the victory as his own. But he then overplayed his hand, saying that government forces were going to reconquer Anbar and announcing grandly that “we turn to the west”.