The Pentagon has confirmed that it has lost a $21-million drone in an Iraqi desert after photos of the crashed UAV surfaced on social media.

The MC-1Q Gray Eagle drone crashed near the government-controlled city of Samawah in southern Iraq on July 16, Defense Department spokesman Army Major Roger Cabiness said in a statement.

The unmanned aircraft was returning from a surveillance mission when “technical complications" caused a loss of communication, he added.

A U.S drone crashed in the desert of Samawa province in southern iraq earlier today pic.twitter.com/VbQiCPJFJ6 — Steven Nabil (@stevoiraq) July 21, 2015

"There were no weapons on board the aircraft. We are working with Iraqi authorities to recover the aircraft," Cabiness is cited as saying by the Hill.

The crash appears to have caused some excitement at the scene. Locals rushed to the site and Iraqi activist Steven Nabil even posted several selfies with the drone.

The UAV, valued between $21-31 million, was found by a shepherd, according to General Yahya Al-Zubaidi, spokesman for the Joint Operation Command.

"I talked to US advisers and they confirmed that they lost a drone two weeks ago. The shepherd called the police and a unit from the Samawa Police Directorate arrived at the location and they took it to the Al-Mamlaha police station,” Al-Zubaidi said, as cited by NBC News.

NEW photo :The U.S drone that crashed in Samawa province ( near the cement factory) pic.twitter.com/0j93LoE2az — Steven Nabil (@stevoiraq) July 21, 2015

Intelligence-gathering and armed drones have been deployed by the US in Iraq and Syria in order to participate in the US-led air strikes against the Islamic State.

It’s the third drone the Pentagon has lost in recent in months as technical problems caused the crash of a military UAV in Iraq in May, while another was shot down in Syria in March.