The Islamic State of Iraq and Syria evolved from its previous incarnation as Al Qaeda in Iraq, but recently Al Qaeda’s central leadership disavowed the group, which has taken on an increasingly important role in the fighting in Syria, as well as in Iraq.

Along with the increase in attacks on Iraqi civilians in Baghdad and elsewhere, the Islamic State of Iraq and Syria and other Sunni extremist groups have captured territory in western Anbar Province, and for weeks they have controlled the city of Falluja and parts of Ramadi, the provincial capital. Other areas of the country have also become strongholds of the Islamic State and of Al Qaeda.

Terrorist training camps have been set up in the mountainous areas of Diyala Province. Northern Nineveh Province has become a gateway for jihadis traveling from Iraq to Syria. Mosul, Nineveh’s capital, has become a center of financing for militant groups estimated by one Iraqi official at millions of dollars a month, generated by extortion and other schemes.

Suicide attacks make up an increasing share of the operations financed by this money stream. At a congressional hearing last week, Brett McGurk, a senior State Department official, said 50 suicide attacks occurred in Iraq in November, compared with three in November 2012. “The suicide bomber phenomenon, it is complete insanity,” Mr. McGurk said.

In addition to the 22 militants who were killed, 15 others were wounded in the explosion on Monday at the militant compound, in a rural area of northeastern Salahuddin Province, according to police and army officials. Stores of other explosives, including explosives packed in at least 10 vehicles, ready for operations, were found at the camp, as well as heavy weapons, the officials said.

Eight militants were arrested when they tried to escape, the officials said. The militant commander who was conducting the training was not identified by name, but an Iraqi Army officer described him as a prolific recruiter who was “able to kill the bad guys for once.”

Referring to the recruiting pitch that martyrdom is a sure ticket to heaven and the virgins that await there, the officer added, “Maybe this suicide bomber will really get to heaven as they say.”