Iraqi fighter jets pounded a town near Fallujah that had been seized by al-Qaeda-linked militants, and commandos swept in Wednesday to clear the area, senior military officials said. It was a rare victory for government forces that have been struggling for nearly three weeks to regain control of the mainly Sunni area west of Baghdad.

North of the capital, a bomb tore through a funeral of a Sunni militiaman opposed to al-Qaeda, the deadliest in a string of attacks that killed at least 50 people nationwide in the course of the day.

Violence has risen sharply as extremist Islamist militants try to exploit growing anger among the Sunni minority over what they perceive as mistreatment and random arrests by the Shiite-led government.

Members of the Islamic State of Iraq and Syria, which is linked to al-Qaeda, made a push to seize parts of mainly Sunni Anbar province as violence erupted after the government on Dec. 28 arrested a Sunni lawmaker sought on terrorism charges, then dismantled an anti-government Sunni protest camp in the provincial capital, Ramadi.

Prime Minister Nouri al-Maliki has held off ordering an all-out offensive against the extremists because of fears that civilian casualties could incite Sunni anger and push moderate tribal leaders to side with the militants.

Wednesday’s counterattack came a day after al-Qaeda militants blew up an explosives-laden fuel tanker at an army checkpoint, killing three soldiers, on a bridge near Saqlawiya, just north of Fallujah.

Gunmen then stormed into the town and surrounded the main police station, forcing out the police. Security forces responded with airstrikes targeting the gunmen, who fled, allowing Iraqi troops to enter the town later Wednesday. However, the militants retain control of large swaths of Ramadi and Fallujah.

Tensions remained high elsewhere as violence soared.

The funeral bombing occurred in the town of Buhriz, 35 miles north of Baghdad, killing 16 people inside a mourning tent, according to security and health officials.

The funeral was for a Sunni militiaman opposed to al-Qaeda who died of natural causes two days ago. The Sunni militia, known as the Awakening Council, was formed by U.S. forces during the height of the insurgency. Its members are seen as traitors by al-Qaeda’s local branch and other militant groups.

In Baghdad, bombings killed at least 28 people, including two that targeted outdoor markets and several car bombings in mainly Shiite areas, according to officials.

A roadside bomb also hit a military convoy near the northern city of Mosul, killing six soldiers, officials said.

— Associated Press