Providing water to much of Nineveh province, the dam is the biggest in Iraq but its huge capacity of 12 billion cubic metres is also its biggest danger.

A US military survey in 2006 called it “the most dangerous dam in the world” after concluding a collapse of its wall could unleash a 20 metre-high wave on the city of Mosul, wiping away anything in its path.

A letter to the Iraqi government warned that 500,000 people could be killed in the city of 1.7 million if the disaster occurred.

Video: Iraqi and Kurd forces take back Mosul Dam

General David Petraeus, who went on to be commander of the International Security Assistance Force and director of the CIA, urged the then Iraqi Prime Minister Nouri al-Maliki to make repairs a national priority.

“A catastrophic failure of the Mosul Dam would result in flooding along the Tigris River all the way to Baghdad,” he wrote in 2007.

“Assuming a worst-case scenario, an instantaneous failure of Mosul Dam filled to its maximum operating level could result in a flood wave 20m deep at the city of Mosul, which would result in a significant loss of life and property.”

The Iraqi government dismissed the claims at the time as “totally untrue”, insisting the dam was well-maintained and there was no cause for concern.

But according to the American assessment, the Islamic State’s capture of the area at the start of August effectively put them in control of a weapon of mass destruction.

Iraqi Kurdish Peshmerga fighters celebrate recapturing the Mosul dam from Islamic State jihadists
As well as the potential disaster along the Tigris river, it is a key component in Iraq's national power grid, with four 200 megawatt turbines generating electricity for millions of homes.

It feeds irrigation systems across the region and balances river levels for flood controls.

The dam, 45 miles upstream of Mosul, has been a problem for Iraqi engineers since it was constructed in 1984.

It was built as one of Saddam Hussein’s pet projects to bolster his regime during the war with Iran and the filling of the reservoir submerged many archaeological sites, including the historical castle of Aski Mosul.

Because the foundations consist of soluble gypsum, the dam needs continuous maintenance to plug leeks with concrete and stop a breach.