The violence erupted after local police opened fire on demonstrators protesting poor services and corruption outside the governorate of Wasit province in the city of Kut, killing three and wounding more than 50, said Capt. Mahdi Abbas of the province's emergency police force.

The angry crowd then attacked the building as the governor escaped through a back door with his bodyguards, Abbas said. Footage broadcast on Iraqi television showed black smoke billowing from the headquarters as protesters clambered over walls into the compound.

Other members of the provincial council also reportedly escaped, and the Iraqi army was called in to quell the turmoil.

Prime Minister Nouri al-Maliki, who has clearly been unsettled by an upsurge of protests around the country in the weeks since the revolts in Egypt and Tunisia, declared an indefinite curfew in Wasit and promised an investigation into the actions of the police officers who opened fire.

Unrest was also reported in the small southern town of Afak, in neighboring Diwaniyah province, where demonstrators stormed a building housing the city council and set it ablaze.

Four protesters were wounded by police gunfire there earlier this month in one of the first in the wave of demonstrations sweeping Iraq. Most have lacked any unifying sense of purpose or organization, with lawyers, judges, students, oil workers and others gathering in small numbers to voice specific complaints. Many of the protests have centered on two of the biggest problems the Iraqi government has failed to address: the chronic lack of electricity and widespread corruption.

But as the Kut demonstration's rapid descent into chaos suggests, these accumulated grievances among a disillusioned populace could prove destabilizing for Maliki as he embarks on his second term in office ahead of the withdrawal of U.S. troops at the end of the year.

"This is very, very dangerous," said political analyst Ibrahim Sumaiedi. "Society is divided along ethnic and sectarian lines, and everyone is armed. If this happens in other cities in Iraq, we will face not reform or change but something far more devastating, because there are a lot of weapons in Iraq."

Anticipation is building around what has been billed as a "Revolution of Iraqi Rage" on Feb. 25, a month after the Facebook-organized "Day of Rage" in Egypt that led to the toppling of President Hosni Mubarak. Numerous groups have sprung up on the Internet urging Iraqis to take to the streets that day.

But Internet penetration is low in Iraq compared with Egypt, especially in impoverished provinces such as Wasit, bordering Iran, where Wednesday's violence occurred. There, grievances about poor governance and corruption are long-standing, and the provincial council has twice voted to oust the governor, who is widely accused of corruption.

Reached by telephone at police headquarters in Kut, where he took refuge, the governor, Latif Hamad al-Turfa, blamed the upheaval on "thugs and gangs."

"They sabotaged and destroyed state property," he said. "They did not have any clear demands about services or unemployment, but rather they only came out to bring chaos."

A former stronghold of supporters of the radical Shiite cleric Moqtada al-Sadr, Kut was pacified by Iraqi security forces in 2008, when all of mostly Shiite southern Iraq was brought under government control.

Earlier this week, Sadr issued a statement throwing his support behind the wave of demonstrations underway in Iraq, and also urging protesters to be peaceful. After returning to Iraq with much fanfare last month, Sadr has since gone back to the Iranian city of Qom, where his spokesmen say he has resumed his studies to become an ayatollah.

Although some officials accused Sadrists of promoting the violence in Kut, it appeared the protests were organized by an impromptu and newly formed group called Youth of Kut, spearheaded by an unemployed university graduate in an echo of the demographic dynamic that spurred the revolts in Tunisia and Egypt.

Qeis is a special correspondent. Special correspondent Saad Sarhan in Najaf contributed to this report.