Several hundred US and Iraqi troops took part in the Diyala operation.
In a separate incident on Wednesday in Mosul to the north, armed men raided an Iraqi police checkpoint on Wednesday and killed five policemen and a civilian, police said.
The prime minister said on Wednesday that his troops had restored calm to the city and blamed “outlawed armed criminal gangs from the remnants of the buried Saddam regime” for the violence.
Fighters attacked the offices of a powerful Shia party in at least five cities, setting many of them ablaze.
Al-Maliki, in a statement, said: “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.”
Sporadic and occasionally sustained gunfire could still be heard after dawn in the city, coming from the area around the shrines of Imam Hussein and Imam Abbas.
The fighting killed 52 people and wounded 206 on Tuesday, a senior security official in Baghdad said.
The general director of the al-Hussein hospital in Karbala, 110km south of the capital, said it had received 34 bodies and treated 239 wounded.
Ali Kadhum, an official at the shrines’ media office, said the two shrines had been slightly damaged, with bullets hitting their domes and minarets and an electric power station ruined.
Hundreds of thousands of pilgrims had gathered in the city to mark the birthday of the 12th and last Shia imam.
|Thousands thronged the city to mark the
12th imam’s birthday [GALLO/GETTY]
Pilgrims had earlier complained about the level of security – which they said was so high it made movement frustratingly slow near the Imam al-Hussein mosque.