Dozens of people have been killed in clashes between members of a Shia cult and police in the southern Iraqi cities of Nasiriya and Basra, police say.
The governor of Basra province said police had surrounded the gunmen
Street warfare erupted as members of the Soldiers of Heaven launched apparently co-ordinated assaults on police positions and fellow Shia.
The office of Iraqi Prime Minister Nouri Maliki said security forces had regained control of the two cities.
Clashes between the cult and Iraqi troops last year left 263 people dead.
The latest test for the security forces came as Iraqi Shia cleric Moqtada Sadr warned he might not extend a six-month ceasefire by his militia, the Mehdi Army.
The truce, due to expire next month, has been credited by the Americans with helping bring about a big improvement in security in Iraq.
But a spokesman for the cleric, Salah Obeidi, said the results had been disappointing because criminal gangs were still operating inside the security forces with government support.
Friday's gun battles were blamed by the prime minister's office on "heretics" who attacked Shia commemorating Ashura and tried to seize a "government institution" in Basra.
About eight hours after the clashes began, the government said Iraqi security forces had restored relative calm to both cities.
The fighting in Nasiriya - 375km (235 miles) south-east of Baghdad - began at around midday local time when mortars were fired at a police position in the city, police said.
The bombardment was followed up shortly afterwards with an assault by members of the Soldiers of Heaven, according to officials.
They were armed with machine guns and rocket propelled grenades and carrying the cult's yellow flags.
At least 15 people were killed in the ensuing clashes, including a city police commander and seven other officers, police said. A woman civilian and three militants also died.
SOLDIERS OF HEAVEN
January 2007: Iraqi officials say 263 cult members killed in fighting in Najaf
Former cult leader Dia Abdul-Zahra Kazim Krimawi, aka Samer Abu Kamar, killed in Najaf battles
Iraqi government claimed cult planned to kill top Shia clerics and declare the Mahdi had come during Ashura
Current leader, Ahmed Hassani Yamani, reportedly claims to be an ambassador of the Mehdi
Later, a curfew was imposed on the city and hundreds of troops were deployed to reinforce police positions.
In Basra, officials said dozens of people were killed after members of the doomsday cult went on the rampage attacking police and civilians.
The city's police chief, Maj Gen Abdul-Jalil Khalaf, said the leader of the cult in Basra, whom he identified as Abu Mustafa Ansari, had been killed in the fighting along with two other gunmen and two police officers.
A mosque belonging to the cult was also set alight after people inside the building fired upon a police patrol, officials told the Associated Press.
The violence marred the Ashura ceremonies, one of the holiest events in the Shia calendar, which marks the killing of Imam Hussein, grandson of the Prophet Muhammad, in 680 AD.
The religious ceremonies are due to reach a peak on Saturday with up to two million pilgrims gathering in the central Iraqi city of Karbala.
The violence marred Ashura commemorations
Last year, more than 260 members of the Soldiers of Heaven were killed in clashes with US-backed Iraqi security forces after officials reportedly uncovered a plot to attack the holy city of Najaf and kill its religious leaders during Ashura.
The cult is said to believe that its former leader, Dia Abdul-Zahra, who was killed in the fighting, was the Mehdi - a ninth century messiah.
The cult has since been led by Ahmed Hassani Yamani, who reportedly claims to be an ambassador, rather than a descendent, of the Mehdi.
BBC religious affairs correspondent Frances Harrison says it is believed that the Mehdi did not die but went into hiding and will one day return, accompanied by Jesus, to save the world once it has descended into chaos.