The United Arab Emirates is to give $50m (£36m) to help rebuild a landmark mosque in the Iraqi city of Mosul blown up by Islamic State militants.

The UN's cultural agency said a five-year project would restore and reconstruct faithfully the Great Mosque of al-Nuri and its leaning minaret.

The mosque is where IS leader Abu Bakr al-Baghdadi proclaimed the creation of a "caliphate" in 2014.

The jihadist group destroyed it three years later as Iraqi troops closed in.

All that was left was the base of the minaret and a dome supported by a few pillars.

At the time, Iraq's prime minister said the destruction of the mosque was an "historic crime" that represented the "formal declaration" by IS of its defeat in Mosul.

The battle for the city lasted almost nine months, left large areas in ruins, killed thousands of civilians and displaced more than 900,000 others.

The director general of the UN Educational, Scientific and Cultural Organisation (Unesco) said on Monday that its partnership with the UAE and Iraqi governments was "the largest and unprecedented co-operation to rebuild cultural heritage in Iraq ever".

The first year of the project will focus on documenting and clearing the site of the Great Mosque of al-Nuri, as well as drawing up plans for its reconstruction.

The next four years will focus on the restoration and rebuilding of the famous leaning minaret, the prayer hall, and adjacent buildings.

Mosul's historic gardens and other open spaces will also be restored as part of the project, and a memorial and museum built.

"The five-year project is not just about rebuilding the mosque, the minaret and the infrastructure, but also about giving hope to young Iraqis," UAE Culture Minister Noura al-Kaabi said during a ceremony at Baghdad's National Museum.

"The millennia-old civilisation must be preserved."

The Great Mosque was named after Nur al-Din Mahmoud Zangi - famous for mobilising and unifying Muslim forces to wage jihad against the Christian Crusaders - who ordered its construction in 1172, shortly before his death.

Despite its connection to such an illustrious figure, all that remained of the original mosque until last year was its minaret - nicknamed "al-Hadba", or "the humpback" - some columns and the mihrab, a niche indicating the direction of Mecca.

It is not clear whether the minaret would be rebuilt with its distinctive lean - Unesco calculated in 2012 that it was 2.5m (8.3ft) off the perpendicular axis.

The minaret was originally 45m (150ft) high. But by the time the explorer Ibn Battuta visited Mosul in the 14th Century it was already listing significantly.

The cause of the tilt was not fully known. But experts believed it was caused by the prevailing north-westerly winds, the effect of the sun on the bricks on the southern side, or the weak gypsum used to hold the bricks together.

Bombs that struck Mosul during the Iran-Iraq War also broke underground sewage pipes near the base of the minaret, weakening the foundations.