BAGHDAD -- Iraq's prime minister on Thursday ordered an investigation into overnight explosions that tore through a mosque in Baghdad as officials raised the casualty toll to 18 dead and 38 wounded. The blasts took place in Baghdad's Sadr City when a weapons depot exploded inside a Shiite mosque, the officials said.

It was not clear what triggered the explosions that destroyed or damaged 20 homes.

The officials spoke on condition of anonymity because they were not authorized to speak to the media.

Iraqis inspect the aftermath of an explosion in Baghdad's Sadr City district, June 7, 2018. Getty

In a statement issued by his office, Prime Minister Haider al-Abadi said that storing weapons in a crowded residential area by "unauthorized parties" was a "crime that led to the killing of innocent people."

Get Breaking News Delivered to Your Inbox

Al-Abadi directed the Interior Ministry to take "legal deterrent measures" against those who "committed this crime." He ordered security forces to conduct searches inside and outside the cities to confiscate weapons from parties "outside the official security forces," referring to Shiite militias.

Sadr City is considered one of the main strongholds for supporters of Muqtada al-Sadr, a Shiite cleric whose supporters once fought American troops in Iraq in the years after the U.S.-led invasion of Iraq in 2003.

Al-Sadr's followers won the largest number of seats in Iraq's May 12 parliamentary elections but would have to form a coalition government with other blocs in a process that could drag on for months.

Al-Sadr also commands a government-backed paramilitary force that took part in the nearly three-year war against the Islamic State of Iraq and Syria (ISIS) after it seized large swathes of Iraq's territory in 2013 and 2014. Iraq declared victory over ISIS last year, but the extremist group retains pockets in western and northern Iraq and continues to stage attacks on security forces.