Deadly fighting hit Kirkuk province in north Iraq Tuesday, with 27 people killed in clashes between protesters and security forces and 13 gunmen dying in subsequent revenge attacks on the army, officers said.
The clashes mark the deadliest eruption of violence linked to protests in Sunni areas that began more than four months ago.
The protesters have been demanding the resignation of Shiite Prime Minister Nuri al-Maliki and railing against the alleged targeting of their community by the authorities.
Tuesday's violence broke out around 5:00 am (0200 GMT) when security forces entered an open area near Hawijah, west of Kirkuk province's eponymous capital, where demonstrations have been held since January, said senior army officers, who gave an overall toll of 27 people killed and around 70 wounded.
But accounts differed as to the spark for the bloodletting.
A brigadier general from the Iraqi army division responsible for the area said the operation was aimed at Sunni militants from a group known as the Naqshbandiya Army, and that security forces only opened fire after they were fired upon.
A second officer said that 34 Kalashnikov assault rifles and four PKM machineguns were recovered at the scene.
Two soldiers were killed and seven wounded in the operation, while the remainder of the casualties were a combination of protesters and militants, the officers said.
Protesters, however, insisted the army had provoked the clashes.
Security forces "invaded our sit-in today, burned the tents and opened fire indiscriminately and killed and wounded dozens of protesters," Abdulmalik al-Juburi, a leader of the Hawijah sit-in, told AFP.
"We only have four rifles to protect the sit-in, and there are no wanted people among us," Juburi said.
The dawn violence sparked revenge attacks.
Thirteen gunmen were killed in attacks on checkpoints in the Al-Rashad and Al-Riyadh areas of Kirkuk province, the army officers said.
"There have been fierce clashes which led to the killing of 13 revolutionaries against the policy of the government," Juburi said.
"When they heard the news about the killed and wounded in the sit-in, sons of the tribes from all the villages in Kirkuk cut the roads and attacked checkpoints and military headquarters and took control of some of the checkpoints for a short time," he said.
Hassan Toran, leader of the provincial council of Kirkuk, where Hawijah is located, said the council condemned "the government forces breaking in to the sit-in and using extreme force, which led to killing and wounding dozens."
"We, as a provincial council, already warned and called for calm," Toran added. "What happened today makes us ask the United Nations to intervene."
A curfew has been imposed on Hawijah and neighbouring areas.
The violence came just hours after United Nations envoy Martin Kobler called for restraint on both sides in Hawijah, where tensions have been ratcheting up.
"I encourage the Iraqi security forces to exercise the utmost self-restraint in maintaining law and order and the demonstrators to continue to preserve the peaceful character of the demonstrations," Kobler said in a statement.
Tuesday was not the first time that anti-government demonstrations in Iraq have turned deadly -- security forces killed a protester in the north Iraq city of Mosul on March 8, and eight demonstrators near Fallujah, west of Baghdad, on January 25.
Also on Tuesday, two roadside bombs exploded as Sunni worshippers were leaving dawn prayers in south Baghdad, killing at least four people and wounding 14, officials said.