Facing pressure from the U.S. to curb the militias, the move allows Prime Minister Adel Abdul-Mahdi to demonstrate a tough stance ahead of a planned visit to Washington, expected to take place in the coming weeks.
It is unlikely, though, that he would be able to rein in the powerful Iran-supported militias, and he risks coming off as a weak and ineffective leader if he doesn't.
Besides having built credibility as an effective force against the Islamic State group, the mainly Shiite militias, known collectively as the Popular Mobilization Forces, are a significant political force, with government ministers and 48 seats in the 329-member parliament.
The PMF "is among the parties that achieved victory for Iraq against (the Islamic State group), liberating Mosul and restoring security to the country. The time has come to organize their status in a legal way... meaning no weapons outside the framework of the state," Abdul-Mahdi told reporters at a weekly news conference Tuesday.
That's a tough sell in a country awash with arms and militias, many of which operate outside the state's control.
The leaders of the larger militias, like Asaib Ahl al-Haq, Badr and the Peace Brigades, welcomed the decision, calling it a step in the right direction. But one militia leader said his group has secret offices that they will not close, calling Abdul-Mahdi's decision a "U.S. directive."
Speaking to The Associated Press on condition of anonymity, he said the prime minister and the Americans "are dreaming" if they think they can implement the decision.
The PMF emerged following a call in the summer of 2014 by Iraq's top Shiite cleric, Grand Ayatollah Ali al-Sistani, for volunteers after Islamic State militants overran nearly a third of Iraq, including the northern city of Mosul, Iraq's second largest.
Iraq's military and security forces collapsed in the face of the onslaught.
Tens of thousands heeded the cleric's call, enlisting in multiple militia factions, many of which had existed for years and even fought American forces in Iraq following the 2003 invasion.
Sanctioned by the Iraqi government but dominated by Shiite groups with close ties to Iran, the militias played a key role in the war against IS and the protection of Shiite shrines in Iraq.
They came out of the war with the image of an almost holy force defending Iraq's Shiite Muslim majority.
That has helped enshrine the militias as a major political and paramilitary player in post-IS Iraq, despite U.S. suggestions that they should be disbanded after IS was driven from the country. Militia factions armed with tanks and heavy weapons are present in almost every Iraqi province, in many cases deeply embedded in local governance and rivaling state institutions. Together, they are believed to number more than 140,000 fighters.
The groups' expanding power, including in some strategic predominantly Sunni areas, worries not only Iraq's Sunni minority but also some officials in the military and the Shiite-led government, who fear the militias will dominate Iraq the way the paramilitary Revolutionary Guard does Iran and the militant group Hezbollah does Lebanon.
"The Iranian regime's objective remains to incorporate the (PMF) as an independent formation within the military structure, a la IRGC, to become an Iraqi Revolutionary Guard," said Joe Macaron, resident fellow at the Arab Center Washington DC, referring to Iran's Revolutionary Guard. "However, there is another Iraqi view within the Shiite establishment that calls for fully integrating the militias in the military."
In March 2018, then-Prime Minister Haider al-Abadi sought to contain the Iranian-backed militias in Iraq by formally making them part of the armed forces - based on a parliament vote in November 2016 - but the militias remained largely independent.
Abdul-Mahdi's decree, issued Monday night, went further than just placing them under the army's command. It ordered the militias to relinquish their militia names and shut down their local headquarters and economic offices. It gave them until the end of the month to comply and said those who do not wish to do so can transform into unarmed political parties. Any armed faction working "openly or secretly" against the new rules would be considered illegitimate.
It did not say how the order would be implemented, nor did Abdul-Mahdi address that at his press conference on Tuesday.
The timing of the decree was noteworthy, amid spiraling tensions between the U.S. and Iran and a string of unclaimed attacks on U.S. interests in the country that have added to regional jitters and raised fears Iraq could be a become a battleground.
The attacks, including rockets fired near the U.S. Embassy and U.S. military bases, have embarrassed the Iraqi leadership, making its delicate balancing act between its two allies significantly more difficult.
While clearly seeking to cater to the U.S., the move by Abdul-Mahdi was also clearly coordinated with Iran, with the understanding that these groups will not be disbanded, nor fully integrated into the military.
Critics called it a toothless decision that will not translate on the ground.
"These factions will not respond to the government, especially (because) they are ideologically aligned with Iran and directly receive orders from Tehran," said Iraqi political analyst Watheq al-Hashimi.
Thafer al-Ani, a Sunni lawmaker, said he hoped it will not be merely "ink on paper," adding that it would have been better to merge the PMF with the security forces and abolish the militias completely. Under the prime minister's decree, the PMF reports to a military commander who reports directly to the premier, rather than being fully incorporated into the defense or interior ministries.
Macaron said Abdul-Mahdi is buying time as he is under pressure from both Washington and Tehran.
Formally placing the PMF under the command of the Iraqi military may be a way of deterring an attack by the U.S. or others. American officials have suggested the U.S. would retaliate against any attack targeting U.S. interests in Iraq.
"Some in Washington and the Arab world are welcoming this Iraqi decree with jubilation but the fact is it will not be implemented without Iranian consent," Macaron said.
"It actually preserves and legitimizes Iranian influence on the long-term," he added.