Prosecutors have charged two 16-year-old boys — each with possession of a handgun by a juvenile — in the wake of a Castle Rock chemical investigation this week that prompted a federal response and forced the evacuation of some 30 homes.

The 18th Judicial District Attorney’s office says one of the teens is also accused of possession of an explosive or incendiary device. His bail was set at $1 million.

The other boy is also accused of two counts of sexual exploitation of a child. His bail was set at $50,000.

Prosecutors are limited in the information they can release about the teens because they are juveniles. Thus, the pair’s names and further details on the allegations against them have not been released.

The ordeal began Monday morning when the pair was arrested in downtown Castle Rock at about 2:30 a.m. Officers could not reach one of the boy’s parents and so went to the family’s home in the Plum Creek neighborhood about 8 a.m. Monday where they discovered a small cache of chemicals in plain view.

The chemicals could have been set off by static electricity when combined, said Lt. Tommy Barrella of the Douglas County Sheriff’s Office bomb squad. Separately, the chemicals pose no threat.

“If those had detonated, and it wouldn’t have taken a whole lot for that to happen, someone could have died in the home,” Cauley said.

The discovery of explosives and chemicals led to the evacuation Monday of about 30 homes in the Plum Creek neighborhood. Residents were allowed to return home early Tuesday after federal and local detonated two unspecified devices discovered in the house.

The home where the chemicals were found has been condemned until authorities can rid it of the chemicals and any fumes or residue, Castle Rock Police Chief Jack Cauley said Tuesday afternoon.

Officials declined to say what kind of chemicals were found, but said all are legally available for the public to buy. Some were in open containers. Some were closed. Some were in beakers and in jars. Some were half empty and others were full, Barrella said.

Investigators have said they believe there is no threat to the public and emphasized that the teens’ initial arrest and the chemical probe are two separate investigations.