The PM's decision came after nine people were killed and dozens others injured as anti-government protests that erupted in the capital Baghdad spread to other city's in the country's south.
Iraq is declaring a curfew in Baghdad starting early on Thursday until further notice, Prime Minister Adel Abdul Mahdi announced late on Wednesday, after two days of nationwide anti-government protests turned violent.
"Statement from the commander-in-chief of the armed forces: all vehicles and individuals are totally forbidden to move in Baghdad as of 5 am [0200 GMT] today, Thursday, and until further notice," Abdul Mahdi said in a statement.
Travellers to and from Baghdad airport, ambulances, government employees in hospitals, electricity, and water departments, and religious pilgrims are exempt from the curfew, the statement said.
Abdul Mahdi said it was up to provincial governors to decide whether to declare curfews in their provinces in Iraq.
Earlier, police sources said a curfew was imposed in the southern cities of Nasiriyah, Amara and Hilla.
Thousands of demonstrators braved live fire across the country and tear gas in rallies that left nine people dead in 24 hours.
Protesters clashed with security forces and in some areas set fire to government and political party buildings.
In Nasiriyah, gun fights between protesters and security forces broke out and elite counter-terrorism troops deployed after police "lost control" of the situation, other police sources said.
Earlier, demonstrations led authorities to seal off the Green Zone in central Baghdad and posed the first major challenge to Prime Minister Adel Abdel Mahdi, who formed his government a year ago this month and who controversially blamed the violence on "aggressors" among the protesters.
Since erupting in Baghdad on Tuesday, the protests have spread to other cities in the country's south, with crowds railing against state corruption, failing public services and unemployment.
On Wednesday, five protesters and a police officer were shot dead in the southern city of Nasiriyah, a provincial health official told AFP.
They brought the death toll in the protests to nine, including one protester who died in Nasiriyah on Tuesday and two others in a large demonstration in Baghdad that degenerated into violence.
In the capital on Wednesday, riot police attempted to disperse crowds in a half-dozen neighbourhoods by unleashing tear gas and live rounds into the air.
Protesters regrouped and tried to reach the capital's iconic Tahrir Square for the second day, but police had sealed off the area.
Later on Wednesday, military vehicles and security forces also deployed around the Green Zone, which hosts government buildings and embassies.
Access to the area would be completely denied "until further notice," a government source told AFP.
The Green Zone had been inaccessible for most Iraqis since the 2003 US-led invasion of Iraq but had reopened to the public in June.
It has often been the focal point for public anger, including in 2016 when supporters of firebrand cleric Moqtada Sadr stormed it and paralysed state institutions.
Late Wednesday, Sadr called for "peaceful protests and a general strike" after calling for a probe into the violence.
'Attack its own people'
In the southern neighbourhood of Zaafaraniya, protesters burnt tyres on streets lined with police vehicles.
"We want jobs and better public services. We've been demanding them for years and the government has never responded," said Abdallah Walid, 27.
Journalists covering protests in central Baghdad said security forces had assaulted them and detained one of their colleagues.
"No state would attack its own people like this. We're being peaceful, but they fired," said unemployed graduate Mohammad Jubury in the nearby Al-Shaab district.
Some 60 people were wounded across Baghdad on Wednesday, including nine from bullet wounds and the rest from tear gas inhalation, medical sources said.
In addition to Baghdad and Nasiriyah, crowds also gathered in the holy city of Najaf and the flashpoint southern city of Basra, which was rocked by protests last year.
Security forces have used live rounds to break up the Baghdad, Nasiriyah and Najaf protests.
Even after Tuesday's protest in Baghdad was dispersed, heavy gunfire could be heard well into the night, including in the Sadr City district, where a funeral was held for the protester killed in the capital.
The other demonstrator killed in the capital was wounded Tuesday and succumbed to his injuries on Wednesday.
It was not clear if bullets were fired directly at protesters or into the air.
Tuesday's bloodshed drew condemnation from President Barham Saleh, who urged "restraint and respect for the law".
"Peaceful protest is a constitutional right granted to citizens," he said.
The UN's top official in Iraq, Jeanine Hennis-Plasschaert, expressed "grave concern" on Wednesday, saying she "deeply regrets the casualties".
She urged authorities to "exercise restraint in their handling of the protests".
Unusually for Iraq, no political faction had explicitly called for Tuesday's protest, which appeared to be largely spontaneous.
The liberal newspaper Al-Bayina Al-Jadida said the protests were, "for the first time without flag, without poster or party slogan".
They follow months of simmering frustration with Abdel Mahdi over a perceived lack of progress on corruption, unemployment or services.
Routine power cuts leave consumers without mains electricity for up to 20 hours a day and, according to the World Bank, youth unemployment runs at around 25 percent, or double the adult rate.
Protests over the same issues engulfed Basra last summer and effectively ended Abdel Mahdi's predecessor Haider al Abadi's chances of a second term.
Abdel Mahdi now faces a similar challenge.
He convened his national security council for an emergency meeting on Wednesday, after paying tribute to the security forces and blaming the violence on "aggressors who... deliberately created casualties".
Interior ministry spokesman Saad Maan told state media on Tuesday that "infiltrators were behind the violent acts in the protests".
Their statements drew widespread online criticism, as some other politicians had thrown their weight behind the protesters.
Parliament has ordered a probe into the violence and its human rights committee criticised security forces for their "suppression" of the demonstrations.