ISIS militants allegedly blew up the landmark al-Nuri mosque and its famous leaning minaret in Mosul where the terror group’s leader three years ago declared a "caliphate," Iraq’s military said in a statement.

Reuters first reported the Iraqi military statement, which was then confirmed by NBC News. The statement said that Iraqi military forces, which are battling to retake the city from ISIS, were 80 yards away when the explosion occurred.

But ISIS, through its Amaq news agency, claimed that it was actually an American airstrike that destroyed the mosque.

U.S. military officials also blamed ISIS for the destruction of the mosque. A U.S. official said they did not conduct any planned or deliberate strikes in the area.

"As our Iraqi Security Force partners closed in on the al-Nuri mosque, ISIS destroyed one of Mosul and Iraq's great treasures," Maj. Gen. Joseph Martin, commander of the ground forces component of a coalition working to defeat ISIS in Iraq.

The leaning Al-Hadba minaret, which is part of the al-Nuri mosque, is shown on June 19, 2017 in Iraq. File Mohamed El-Shahed / AFP - Getty Images File

The mosque and its Al Hadba Minaret, built in 1172, had been a symbol of the fight against ISIS in Mosul. ISIS leader Abu Bakr al-Baghdadi declared a "caliphate" — in Iraq and Syria — from the site in 2014.

Related: ISIS Leader Al-Baghdadi May Have Been Killed, Russia Says

Iraqi forces earlier Wednesday moved through Old Mosul to recapture the mosque, which a senior security official said has a symbolic importance for the terror group. U.S. coalition aircraft have been providing airstrikes as Iraqi forces have fought to retake Mosul from the ISIS group, which seized the city in 2014.

Later Wednesday a security official said Iraqi forces were forced to withdraw from areas close to the mosque after facing heavy resistance from ISIS snipers.

The U.S. military statement did not mention airstrikes.

"The responsibility of this devastation is laid firmly at the doorstep of ISIS, and we continue to support our Iraqi partners as they bring these terrorists to justice," Martin said in a statement.

The Iraqi offensive to retake Mosul began in October. Iraqi forces entered Mosul for the first time in two years in November, and on Sunday Iraqi forces started storming the Old City, which is believed to be the group's final stronghold in the city.

This aerial view taken on June 21, 2017 and provided by Iraq's Joint Operation Command reportedly shows destruction inside Mosul's Nuri mosque compound. Handout / AFP - Getty Images

The Al Hadba Minaret has been leaning about 253 centimeters (a little more than 8 feet) off its axis for several years and the United Nations Educational, Scientific and Cultural Organization in 2012 announced plans to help come up with a plan to stabilize it, the group said.

If ISIS did blow up the historic mosque, it would just be the latest instance of the terror group destroying or damaging historic sites after it took control of large swaths of Iraq and Syria.

The group destroyed antique temples and statues in the ancient city of Palmyra in Syria, a 2,000-year-old city that is home to a UNESCO world heritage site, after taking control of that city in 2015.

The Syrian army, aided by Russian forces, drove ISIS out of Palmyra last year and the liberation was celebrated with an orchestra concert there. When Syrian forces took control of the city in March of 2016, Syrian and forces found it rigged to explode, a chief Russian sapper said at the time.

But in December ISIS said it recaptured the city from Syrian forces, The Associated Press reported.

The terror group also laid waste to the archaeological site of Nimrud in northern Iraq and smashed relics in a Mosul museum, officials have said.

The U.S.-led coalition to defeat ISIS, the Combined Joint Task Force-Operation Inherent Resolve, is providing Iraqi forces with equipment, training, and fire support.

U.S. Lt. Gen. Steve Townsend, U.S. and coalition commander in Iraq and Syria, called the destruction of the mosque another reason why the group must be eliminated.

"I was just in Mosul Wednesday afternoon and close enough to see the mosque and its famous leaning minaret. Little did I know it was for the last time," Townsend said in a statement. "This is just another example that ISIS is a cruel, heartless and god-less ideology that cannot be permitted to exist in this world."