The blowing up by Isis of the al-Nuri mosque in Mosul marks a decisive defeat for the caliphate declared by Abu Bakr al-Baghdadi in the same mosque three years ago. Isis will continue fighting as a guerrilla force, but it will be the end of a state once the size of Great Britain and fielding a military force more powerful than many members of the United Nations. Presumably Isis decided to destroy the ancient mosque and its famous minaret, a symbol of Mosul, to prevent the Iraqi security forces triumphantly raising the Iraqi flag over a place so closely associated with Isis.

The end of the short-lived caliphate will be underscored if the self-declared caliph is himself dead, killed by a Russian airstrike near Raqqa some three weeks ago. Oleg Syromolotov, the Russian deputy foreign minister, repeated today a claim made last week but with greater certainty, saying that fresh information showed that there was “a high degree of probability” that Baghdadi was dead, killed after a meeting he was attending was targeted by Russian aircraft.

Isis is losing its last and most important urban centres. Hundreds of its fighters still hold parts of the Old City of Mosul, where the narrow alleyways and close-packed housing are ideal terrain for its swiftly moving snipers and suicide bombers. But all the east side of Mosul, which is divided in two by the Tigris river, is now in the hands of the Iraqi government, as is most of the west side of the city apart from a small embattled enclave.

It has been an epic siege. The assault on Mosul started on 17 October last year when Iraqi ground forces, supported by the massive air power of the US-led coalition, began the operation. Iraqi and US generals expected heavy fighting on the outskirts of Mosul, but looked forward to a much quicker advance once its outer defences were breached. This had been the pattern when government forces recaptured Ramadi and Fallujah in Anbar province west of Baghdad in earlier offensives. Exactly the opposite happened: Isis adopted different and more effective tactics based on the fluid defence of built-up areas. Instead of defending fixed points to the last man, its snipers, mortar teams and suicide bombers driving vehicles packed with explosives kept moving their positions so they could not easily be located and destroyed by aircraft and artillery.

It took three months for Iraqi forces to capture the eastern part of the city and they were to find the battle even tougher in the west. By 29 March, they had lost 774 dead and 4,600 wounded since October according to a senior US officer. Some 3,500 Isis fighters are reported to have been killed in and around the city between October and May. The government casualties are even more serious than they appear because Iraqi battle-worthy combat troops are limited in number, being mainly concentrated in the counter-terrorism services (Golden Division), federal police and the emergency response division. The soldiers used to occupy captured territory are of far more dubious quality, often belonging to Shia militias or Hashd al-Shaabi.

At the start of the siege the UN reckoned that there were about 1.5 million civilians in Mosul and there are reported to be 100,000 still trapped in the Isis-held Old City. They are forbidden to leave by Isis whose gunmen shoot anybody trying to escape. Some 231 civilians were executed by Isis in recent weeks as they tried to go, according to the UN. The UN High Commissioner for Refugees said separately that since the offensive started in October some 606,000 people have been displaced from Mosul, of whom 190,000 have returned. The level of destruction in west Mosul, going by aerial photographs, looks very high – as do civilian casualties because there is no way of separating Isis fighters from civilians who are living in the same houses.

Isis will have suffered a serious political and military defeat in Mosul, though fierce street fighting in the Old City could go on for months. But Isis will have held out against superior forces backed by the devastating firepower of planes overhead for over seven months, far longer than anybody expected. Furthermore, the group has withdrawn many of its veteran fighters and administrative personnel who can seek sanctuary in rural areas in Iraq and Syria which Isis still holds. The movement is famous for its cruelty and fanaticism, but it also has a high level of military experience and expertise. It will have foreseen inevitable defeat in Mosul and also in Raqqa, its de facto Syrian capital, and withdrawn forces to long-held strongholds in places like Hawaija, west of Kirkuk and in territory in Syria east of Deir Ezzor on the Euphrates and around Mayadeen.

Isis began to lose the war when, confident that its great victories in Iraq and Syria in 2014 had been divinely inspired, it declared war on the world. As a result it has a long list of enemies who are now closing in on it. In the second half of 2014, it turned on the Kurds in Iraq and Syria, thereby provoking US military intervention against Isis in both countries. Sunni states like Turkey, Saudi Arabia and Qatar, which once tolerated or covertly aided Salafi-jihadis, became more cautious.

Though Baghdadi may be dead and surviving Isis forces are being driven into smaller and smaller enclaves in Iraq and Syria, the group will fight on. It can activate cells and sympathisers all over the world to commit high-profile atrocities guaranteed to dominate news agendas. Celebrations over Isis’s defeat may be interrupted and apparently contradicted by its continuing ability to wreak havoc.

ORDER IT NOW

Isis may also draw solace from the growing divisions among its enemies, whose loose collaboration was previously underpinned by fear of the jihadis. As that fear diminishes, there is growing friction between the US and Russia, the US and Iran, Syrian Kurds and Turkey, and, further afield, the confrontation between Qatar, on one side, and Saudi Arabia and the United Arab Emirates, on the other. Isis has always been able to take root and grow from chaos and war.