Violence in Iraq has fallen to its lowest level since the overthrow of Saddam Hussein in 2003, as Isis loses its base areas and its bombing attacks are thwarted by informers and double agents. A senior Iraqi security official says that intelligence about potential Isis attacks has improved to the point that government forces can monitor a bomb from construction to detonation, allowing it to explode after evacuating civilians so Isis does not know that its bomb-making networks have been penetrated.

“We have people who work with Isis who agree to work with us,” said Interior Minister Qasim al-Araji in an interview with The Independent in Baghdad. “Isis does not know this and we make sure our informant is not exposed.” Sometimes security forces even pay for the car that transports a bomb to Baghdad and allow it blow up in a place which Isis has targeted. “We ask people to move and make an official statement with a false number of casualties,” he says.

Mr Araji, a long-time leader of the militant Shia Badr Organisation, got his job as Interior Minister last year when his predecessor resigned in the wake of an Isis car bomb that killed over 300 people in the Karada district in central Baghdad. He says that this could happen again, but is much less likely now because Isis no longer holds cities and districts where it can safely organise and equip bombers. “The main thing is that the caliphate has been broken,” he says. “There is only one town – Rawa – and the western desert where Isis still holds out.”

Iraqi soldiers from guard a popular market in al-Gomhouria Street in central Baghdad (EPA)

Isis shows signs of demoralisation and defeatism as it loses its last pockets of territory, though it leaders are likely to have recognised that it was going to be defeated in Mosul because of the military superiority of its enemies. It will therefore have prepared “sleeper cells” along with desert hideouts and arms, ammunition and food dumps to enable its remaining forces to survive and launch occasional attacks to show they are still in business. Al-Qaeda in Iraq, the predecessor of Isis, was able to recover from defeats by successfully lying low between 2007 and 2012, when it re-emerged as circumstances changed in its favour.

Isis will try to do the same again, but cannot succeed if its networks of militants are exposed and eliminated. Mr Araji, speaking in his office in the Green Zone in Baghdad, says, “We have cooperation from members of important Isis families to help our security units.” He said that the wife of an Isis leader was to make contact later in the day: “We give her money and keep her identity secret, but she does it because she wants to protect her sons and stay alive herself.”

Mr Araji says that there had been no successful Isis attacks during the Arbaeen commemoration when millions of Shia walk to their holy city of Kerbala from all over Iraq. The vast numbers are difficult to defend and they have traditionally been easy targets for Isis suicide bombers who mingle with the crowds. As evidence of greater security, he reads from a dossier prepared for the Prime Minister, Haider al-Abadi, showing that there had been just two attempted suicide bombings during Arbaeen and both the bombers had been killed without hurting anybody else.

In the past, Iraqi officials have privately blamed corruption for the ability of suicide bombers or trucks filled with gunmen to make their way unhindered through government checkpoints. In Mosul, local people say they are frightened when they see Isis fighters, whom they had informed against and had been arrested, back on the streets after – they assume – bribing their way to freedom. Mr Araji agreed that such things did happen and said an officer in the interior was “about to be charged for helping Isis families escape from Mosul to Baghdad”.

Shia Muslim pilgrims gather for the Arbaeen religious festival Show all 20 1 /20 Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims gather for the Arbaeen religious festival Shia pilgrims praying at the Immam Hussein shrine AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia pilgrims gathering in front of the Immam Hussein shrine AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia pilgrims mourning in front of the Immam Hussein shrine AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia pilgrims praying at the Immam Hussein shrine AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia pilgrims pray at the Imam al-Abbas shrine during the commemoration of Arbaeen in Kerbala REUTERS Shia Muslim pilgrims gather for the Arbaeen religious festival Shia pilgrim mourning AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia pilgrims pray at the Imam al-Abbas shrine REUTERS Shia Muslim pilgrims gather for the Arbaeen religious festival Shiite pilgrims gathering in front of the Immam Hussein shrine AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia faithful pilgrims gather between the holy shrine of Imam Hussein and the holy shrine of Imam Abbas AP Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims gather in the southern Iraqi city of Karbala AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival A man flashes the V-sign as Muslim pilgrims gather at the Immam Hussein shrine AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims gather the Immam Abbas ibn Ali shrine in the southern Iraqi city of Karbala AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims gather during the commemoration of Arbaeen in Kerbala REUTERS Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims ahead of the Arbaeen religious festival, which marks the 40th day after Ashura AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival The holiday marks the end of the forty day mourning period after the anniversary of the martyrdom of Imam Hussein AP Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims gather ahead of the Arbaeen religious festival AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia faithful pilgrims march to Karbala AP Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims gather at the Immam Abbas ibn Ali shrine AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims gather in Karbala AFP/Getty Images Shia Muslim pilgrims gather for the Arbaeen religious festival Shia Muslim pilgrims gather REUTERS

The overall mood of senior Iraqi government officials has been transformed over the past six months by the defeat of Isis at Mosul after a nine-month siege. This was the biggest military victory ever won by the Iraqi armed forces, though it had been expected. But the peaceful reoccupation of Kirkuk and territories disputed with the Kurdistan Regional Government was, by way of contrast, an unexpected success, coming after Kurdish President Masoud Barzani had unwisely overplayed his hand and isolated himself internationally by holding a referendum on independence. “If he had agreed to postpone the referendum, he would have made many gains,” says Mr Araji. “As a government we were lucky.”

Mr Araji revealed that Iraqi Kurdistan is not quite as isolated from the outside world as its people might have feared last month when Turkey and Iran were threatening to close land routes in and out of the land-locked Kurdish enclave, unless they were returned to Iraqi government control.

In the event, Turkey and Iran each worry that if they close their border crossings and the other does not, then the one that stays open will get a monopoly of trade. Almost everything is imported in Iraq, and most of these imports come across the Turkish and Iranian borders. Mr Araji says that Iraqi leaders had met President Recep Tayyip Erdogan “who supported the Iraqi central government, but did not talk about closing the border crossings".