IMPERIAL, Calif.  Ten minutes into arrant mayhem in this town near the Mexican border, and the gunman, a disgruntled Iraq war veteran, has already taken out two people, one slumped in his desk, the other covered in blood on the floor.

The responding officers  eight teenage boys and girls, the youngest 14  face tripwire, a thin cloud of poisonous gas and loud shots  BAM! BAM!  fired from behind a flimsy wall. They move quickly, pellet guns drawn and masks affixed.

“United States Border Patrol! Put your hands up!” screams one in a voice cracking with adolescent determination as the suspect is subdued.

It is all quite a step up from the square knot.

The Explorers program, a coeducational affiliate of the Boy Scouts of America that began 60 years ago, is training thousands of young people in skills used to confront terrorism, illegal immigration and escalating border violence  an intense ratcheting up of one of the group’s longtime missions to prepare youths for more traditional jobs as police officers and firefighters.