The militants belonged to a group known as the Islamic State of Iraq and the Levant, or ISIL, which is fighting the Shiite-dominated army of the Iraqi

BAGHDAD—A group of Sunni militants attending a suicide bombing training class at a camp north of Baghdad were killed Monday when their commander unwittingly conducted a demonstration with a belt that was packed with explosives, army and police officials said.

The militants belonged to a group known as the Islamic State of Iraq and the Levant, or ISIL (also known as ISIS), which is fighting the Shiite-dominated army of the Iraqi government, mostly in Anbar province. But they are also linked to bomb attacks elsewhere and other fighting that has thrown Iraq deeper into sectarian violence.

Twenty-two Islamic State of Iraq and the Levant members were killed, and 15 were wounded, in the explosion at the camp, which is in a farming area in the northeastern province of Samara, according to the police and army officials. Stores of other explosive devices and heavy weapons were also kept there, the officials said.

Eight militants were arrested when they tried to escape, the officials said.

The militant who was conducting the training was not identified by name, but he was described by an Iraqi army officer as a prolific recruiter who was “able to kill the bad guys for once.”

The Islamic State of Iraq and the Levant militants drove into Fallujah and the nearby city of Ramadi, both in Anbar province, earlier this year with heavy weaponry, taking control of key intersections and offices of local authorities.

Local security forces and tribes have since re-established control in Ramadi.

But Iraq is developing a plan, with help from the United States, that would have Sunni tribes take the lead in ending the standoff with the Islamic State of Iraq and the Levant in Fallujah, with the Iraqi army in support, a senior State Department official told Congress last week.

The official, Brett McGurk, said that the Islamic State of Iraq and the Levant had about 2,000 fighters in Iraq, and that its longer-term objective is to establish a base of operations in Baghdad, led by Abu Bakr al-Baghdadi, who has been officially designated as a global terrorist by the State Department.

In other violence in Iraq, a roadside bomb detonated in the northern city of Mosul alongside the convoy of the speaker of Parliament, the Sunni leader Osama al-Nujaifi, security officials said. Six of his guards were wounded, but al-Nujaifi was unharmed, they said.

In Baghdad, a doctor was found dead with bullet wounds in his head and chest two days after he was kidnapped from his house, medical officials said.

In the Baya district of southwestern Baghdad, a bomb left near a cafe killed four people and wounded 11, according to a police official.