Deadly fighting hit Kirkuk province in north Iraq on Tuesday, with 27 people killed in clashes between protesters and security forces while 13 gunmen died in revenge attacks on the army, officers said.
Education Minister Mohammed Ali Tamim, a Sunni from Hawijah near where the clashes took place, resigned in the wake of the violence, becoming the third Sunni minister to do so since March.
The fighting was the deadliest to date linked to protests in Sunni areas that erupted 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, according to 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.
One of the officers, 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 army 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.
Iraq's education minister quit in the wake of the clashes, according to an official from Deputy Prime Minister Saleh al-Mutlak's office.
"The minister of education, Mohammed Ali Tamim, resigned from his post after the Iraqi army forces broke into the area of the sit-in in Kirkuk" province, the official said.
"The resignation is final, and there will be no going back."
Tamim, who is a member of Mutlak's National Dialogue Front, is the third Sunni minister to resign since March, and the second to do so after deadly violence at a protest.
Agriculture minister Ezzedine al-Dawleh quit on March 8 after a protester was killed in north Iraq, and finance minister Rafa al-Essawi, some of whose bodyguards were arrested on terrorism charges in December, announced his resignation at an anti-government demonstration on March 1.
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 others, officials said.