Iraqi security forces are driving out Isis fighters from the government compound in the centre of Fallujah, the city 40 miles west of Baghdad which Isis has held for two-and-a-half years.

Heavily armed Interior Ministry police units say they raised the Iraqi flag over the main government buildings on Friday, including the police station and court houses, in the latest stage of an attack that began on 23 May.

Clouds of smoke were rising from the centre of Fallujah as it was hit by airstrikes and artillery fire, while Isis snipers in the General Teaching Hospital tried to pick off advancing government troops.

After a week of heavy fighting on the outskirts of the city, a government spokesman said that Isis resistance had weakened. The offensive is led by elite federal police and Counter-Terrorism Service troops advancing along Baghdad Street that bisects the city, which had a population of 300,000 before it was seized by Isis in January 2014. The number of the government forces has been put at 20,000, the majority of whom belonging to the Shia paramilitary Popular Mobilisation Units (Hashd al-Shaabi).

Some 90,000 civilians remained in the city at the start of the present assault, of whom 68,000 have fled, many of them over the past twenty-four hours since Isis reversed its previous policy of forbidding anybody to leave on pain of death.

Witnesses say that Isis was announcing by loudspeakers that everybody could leave, leading 6,000 families to depart on Thursday alone. Two bridges over the Euphrates River were opened, allowing people to get away from the city centre.

But displacement camps have been overwhelmed. The former mayor of Fallujah before the Isis takeover, Issa al-Issawi, who now resides outside the city said: “We don’t know how to deal with this large number of civilians.”

The exodus of people from the city was also enabled by Isis fighters suddenly retreating from important checkpoints inside Fallujah witnesses told the Norwegian Refugee Council.

The nature of this retreat is important because it could mean that Isis leaders have decided not to risk suffering devastating casualties among their experienced fighters by resisting to the last man in the face of an attack backed by US-led airstrikes which was bound to win in the end.

Isis pursued similar tactics in Ramadi, Sinjar and Tikrit of using snipers, mines and booby traps but fading away at the last minute, often using elaborate networks of tunnels in which to hide and later escape.

Nevertheless, the capture Fallujah by Iraqi government forces, though still continuing and incomplete, is the most serious defeat suffered by Isis in Iraq. Its loss is so significant because the city is close to Baghdad and it has an historic significance for Sunni Arabs as a place always sympathetic to fundamentalist Islam which resisted the US in two famous sieges in 2004.

The Sunni Arabs make up a fifth of Iraq’s 33 million population and their whole community is under pressure as their population centres are captured by the Iraqi security forces and Shia paramilitaries. Many people who once lived in Fallujah have fled to Iraqi Kurdistan because they cannot take refuge in Shia-dominated Baghdad where Shia often suspect displaced Sunni civilians of being Isis infiltrators. Men of all ages leaving Fallujah were being detained on Friday amid claims that some had been murdered and tortured earlier in the week by Shia paramilitaries.

It is unclear how badly Fallujah has been damaged by airstrikes and shellfire, but Ramadi, the capital of Anbar province, was 70 per cent destroyed by artillery and bombing in the second half of last year at the end of which it was recaptured. Most of its population has yet to go home. Human Rights organisations report that men from the city were confined in conditions so cramped that they could not lie down for days at a time.

Iraqi commanders say that Isis is at its last gasp, but this is an exaggeration and in other parts of Iraq it has been able to make limited counter-attacks, killing 24 policemen at Tuz Kharmatu south of Kirkuk. Isis is likely fight much harder for Mosul, which, with a population that once numbered two million, is by far the largest city held by Isis