BAGHDAD -- An instructor teaching his militant recruits how to make car bombs accidentally set off explosives in his demonstration Monday, killing 21 of them in a huge blast that alerted authorities to the existence of the rural training camp in an orchard north of Baghdad.
Nearly two dozen people were arrested, including wounded insurgents trying to hobble away from the scene.
The militants belonged to a network now known as the Islamic State of Iraq and the Levant, an extremist group that recently broke with al-Qaida.
The ISIL, emboldened by fellow fighters' gains in the Syrian civil war, has tried to position itself as the champion of Iraqi Sunnis angry at the government over what they see as efforts to marginalize them.
Car bombs are one of the deadliest weapons used by this group, with coordinated waves of explosions regularly leaving scores dead in Baghdad and elsewhere across the country. The bombs are sometimes assembled in farm compounds where militants can gather without being spotted, or in car workshops in industrial areas.
The explosion Monday took place at a camp tucked away in an orchard in the village of al-Jalam, a farming area that has been a stronghold of al-Qaida close to the Sunni city of Samarra. According to a police officer, an army official and a hospital official, all of whom spoke on condition of anonymity for security reasons, the events unfolded as follows.
The militants were attending a lesson on making car bombs and explosive belts when a glitch set off one of the devices during the car bomb part of the demonstration. Security forces rushed to the area after hearing the thunderous blast and arrested 12 wounded militants along with another 10 trying to flee.
Authorities searched two houses and a garage in the orchard, finding seven car bombs as well as several explosive belts and roadside bombs. The cars did not have license plates. Bomb experts then started the work of defusing the devices.
Later Monday, a bomb exploded near a cafe in western Baghdad shortly after nightfall, killing three people and wounding 11 others, according to police and medical officials who all spoke on condition of anonymity because they were not authorized to speak to media.
The U.S. strongly condemned the assassination attempt on parliament speaker Osama al-Nujaifi, a roadside bombing that wounded one of his bodyguards.
"Speaker Nujaifi has been a strong partner of the United States' efforts in Iraq and we are grateful that he was unharmed in the attack," State Department deputy spokeswoman Marie Harf said in a statement. "Today's attack exemplifies the danger terrorist groups pose to all Iraqis, and the importance of Iraqi leaders from all communities working together to isolate militant groups from the broader population."
Violence has spiked in Iraq since last April, when security forces cracked down on a Sunni protest camp north of Baghdad in clashes that left 45 dead.
The situation deteriorated significantly in late December, when security forces dismantled a protest camp near the Anbar provincial capital of Ramadi. To defuse the tension, the security forces withdrew from Ramadi and the nearby city of Fallujah. ISIL militants promptly took over parts of Ramadi and the center of Fallujah.
The Iraqi government and allied tribes launched an offensive on Jan. 26 to wrest control of the cities back from the militants. Sporadic clashes are still continuing around Fallujah and in some parts of Ramadi, with only limited success by security forces.
Associated Press writer Sinan Salaheddin contributed to this report.