The Iraqi Prime Minister, Nouri Maliki, has imposed a curfew in the city of Karbala after fierce fighting on Tuesday killed more than 50 people.
Hundreds of thousands of Shia pilgrims have been ordered to leave
The clashes between security forces and gunmen cut short a major religious festival in the city, which had drawn hundreds of thousands of Shia pilgrims.
Mr Maliki said calm had been restored and blamed "criminal gangs from the remnants of the buried Saddam regime".
Security officials had earlier blamed the militia loyal to Moqtada al-Sadr.
But the radical Shia cleric denied the Mehdi Army had been involved and appealed for calm late on Tuesday.
Mr Maliki imposed the indefinite curfew in Karbala at 1100 (0700 GMT) after meeting local officials and inspecting the scene of the clashes early on Wednesday.
The prime minister said security forces had restored order in the city after "criminal gangs" attempted to take control of the area around two of the most important shrines in Shia Islam.
"The terrorist acts implemented by these hired groups led to the martyrdom and the injury of a number of pilgrims and damage to public property," he said in a statement.
"The situation in Karbala is under control after military reinforcements arrived and police and military special forces have spread throughout the city to purge those killers and criminals."
Iraqi television has reported that Mr Maliki also issued an order to dismiss the army commander in Karbala, who will now face an investigation over the handling of the security situation.
The hundreds of thousands of Shia pilgrims attending the Shabaniyah festival in the holy city of Karbala have also been told to leave.
The pilgrims from across Iraq and further afield had been gathering at the shrines of Imam Hussein and Imam Abbas to mark the anniversary of the birth of the 12th Shia imam when the fighting erupted.
Gunmen with rocket-propelled grenades and automatic rifles had forced their way past checkpoints and appeared to be trying to take control of the area around the shrines.
As security forces fought back, several hotels were set ablaze.
The BBC's Mike Wooldridge in Baghdad says various sources blamed the attack on the Mehdi Army. In Karbala, the police are linked to their political rivals, the Supreme Iraqi Islamic Council (SIIC).
In apparently related violence between the two groups in Baghdad, at least five people were killed.
It comes just two days after Mr Maliki announced a deal between Iraqi Shia, Sunni and Kurdish politicians aimed at building national unity.
In other violence, a US soldier died shortly after being wounded in fighting near the northern city of Kirkuk on Tuesday, the US military said.