"There is an order for them to leave," Ali Mussawi, spokesman for Iraqi Prime Minister Nuri al-Maliki, told AFP.
Baghdad opened a probe into the events surrounding the deaths of the members of the People's Mujahedeen Organisation of Iran, which occurred on Sunday at Camp Ashraf in Diyala province, but accounts of the unrest still differ markedly.
The United Nations and Western governments have condemned the bloodshed, but have been careful not to assign blame.
"The state has the right to order them to leave," Ali Mussawi, spokesman for Iraqi Prime Minister Nuri al-Maliki, told AFP.
"There is an order for them to leave."
The UN's mission to Baghdad said in a statement that it believed the Iraqi government "will move to enforce this order without delay".
That would require the 42 remaining residents of Camp Ashraf to be moved to Camp Liberty, a former US military base on the outskirts of Baghdad, while PMOI members await relocation outside of Iraq.
Iraqi officials and the PMOI have offered conflicting narratives of how the 52 died.
The authorities blame infighting within the PMOI for the deaths, and insist no soldiers entered Ashraf.
Those accounts are sharply contested by the PMOI, which charges that Iraqi forces entered the camp, killed 52 of its members and set fire to the group's property and goods.
Last weekend's deaths follow two mortar attacks earlier this year on Camp Liberty in which at least eight people were killed.
Around 3,000 members of the group, which is also known as the Mujahedeen-e-Khalq (MEK), were moved from Ashraf last year to Liberty, but about 100 stayed on at the old camp to deal with remaining property and goods.
Former Iraqi dictator Saddam Hussein allowed the rebel MEK to set up the camp during his war with Iran in the 1980s.
The group was founded in the 1960s to oppose the shah of Iran, and after the 1979 Islamic revolution that ousted him it took up arms against Iran's clerical rulers.
It says it has now laid down its arms and is working to overthrow the Islamic regime in Iran by peaceful means.