BAGHDAD -- A suicide bomber struck a packed funeral ceremony at a Shiite mosque in northern Iraq on Wednesday, killing at least 24 people and wounding dozens in an attack likely to further deepen the country's ethnic and sectarian rifts.

The bomber detonated his explosives at the Sayyid al-Shuhada mosque in Tuz Khormato as mourners marked the death of a government employee who was killed in a drive-by shooting a day earlier, according to witnesses. A number of provincial officials were among those hurt in the attack.

Mayor Shalal Abdoul said that 24 were killed and at least 50 people were wounded in the bombing.

The scene was chaotic at a nearby hospital where many victims were taken. Associated Press television footage showed medics rushing to treat some of the wounded on a blood-streaked floor as bystanders carried in more victims arriving in pickup trucks and the backs of compact cars.

Yalmaz Ogolu, the owner of a television channel in the nearby city of Kirkuk, said he was just leaving the funeral when the attack occurred.

"I heard a thunderous boom come from the mosque," he said. "Seconds later, I saw panicked people fleeing the mosque while others carried bodies and wounded people out."

"Police soon showed up and started shooting in the air," presumably to disperse the crowd in case of a follow-up blast, he said.

The attack underscores the challenges facing Iraq's government as it struggles to maintain law and order more than a year after the last U.S. troops left.

Wednesday marked at least the fifth time this month that insurgents managed to carry out attacks claiming more than 20 lives in a single day.

The bombing came a day after a string of attacks, including three car bombs in and around Baghdad, killed at least 23 people Tuesday.

The U.S. Embassy in Baghdad quickly condemned the bombing, saying it intentionally targeted men, women, and children.

"The deliberate targeting of innocent civilians is cowardly and reprehensible. This attack is meant to incite others into violence and is harmful to the interests of all Iraqis," the embassy said.

The upsurge in violence has coincided with a wave of Sunni-led protests against Prime Minister Nouri al-Maliki's Shiite-led government over what the Sunnis see as unfair treatment of their sect.

Ethnic tensions are also rattling Iraq's stability.

Tuz Khormato, where Wednesday's attack struck, sits in a band of territory contested by Arabs, Kurds and Turkomen.

The city was the scene of an exchange of fire in November that pushed the Iraqi government and the Kurds, who have their own armed force, into a military standoff along the disputed territories that has yet to be resolved.

Those wounded in Wednesday's attack include the deputy governor of Salaheddin province, Ahmed Abdul-Jabar, and provincial council member Ali Hashim Mukhtar, said Kirkuk mayor Munir al-Qafily, who was also hurt in the blast.

There was no claim of responsibility for the attack. But it bore the hallmarks of al-Qaida's local franchise, which often uses indiscriminate, high-profile killings to sow fear and undermine the government's authority.

Violence has fallen since the peak of the insurgency in Iraq several years ago, but lethal attacks launched primarily by Sunni extremists still occur frequently.

The attacks exacerbate Iraq's struggle to maintain stability amid a series of political crises that have wracked the country since the U.S. military withdrawal in December 2011.

Earlier in the day, a roadside bomb apparently intended for a passing police vehicle in Baqouba hit a minibus instead, killing one and wounding four, according to police.

In another attack near Fallujah, police gunmen killed a local leader of the Sahwa, a group of Sunni fighters who joined forces with the U.S. military to fight al-Qaida at the height of Iraq's insurgency. Sunni insurgents frequently target Sahwa members, because they consider them to be traitors.

A suicide bomber last week assassinated Sunni lawmaker Ifan Saadoun al-Issawi, who was one of the main founders of the Sahwa in Fallujah. A day later, a series of blasts struck the northern city of Kirkuk, which like Tuz Khormato is home to a mix of Arabs, Kurds and Turkomen, who all have competing claims to the oil-rich area.