A former federal security official accused of making methamphetamine inside a highly secured government research facility and causing an explosion was conducting an "unauthorized training experiment" at the time of the incident, according to his attorney.

Attorney Steven Van Grack said former National Institutes of Standards and Technology (NIST) police lieutenant Christopher Bartley's experiment "clearly failed."

A police officer with a federal agency who is accused of causing an explosion while making methamphetamine was conducting an experiment and will plead guilty, according to his attorney. Scott MacFarlane reports.

Prosecutors say Bartley "knowingly and intentionally" attempted to manufacture meth, a controlled substance under federal law, according to court records obtained by the News4 I-Team.

Pseudoephedrine, drain opener and a recipe for methamphetamine were found inside NIST's Building 236 -- the special projects facility on the Gaithersburg, Maryland, campus -- in the aftermath of an explosion July 18, federal law enforcement sources said.

The explosion ripped through a NIST lab about 7:30 p.m. July 18, sending a blast shield flying about 25 feet, indicating the explosion was powerful.

Bartley, 41, of Gaithersburg, Maryland, was charged with attempting to manufacture methamphetamine by a federal prosecutor in Greenbelt. Van Grack expects Bartley to plead guilty in federal court Friday. He is hopeful Bartley will avoid prison time by entering the plea and said his client has an "immaculate background."

Bartley resigned the day after the explosion, NIST spokeswoman Gail Porter said Tuesday.

"NIST has been fully supporting the ongoing investigation and will continue to cooperate with law enforcement as requested," Porter said.

Court records say the attempted drug making occurred July 18, the day of the explosion. A charging document does not specify where the attempts were made.

The FBI took over the investigation in late July after the explosion on the government campus. Authorities said at the time that the blast could have been tied to drug manufacturing.

A U.S. attorney for Maryland confirmed Tuesday that Bartley was the federal law enforcement officer who was injured in the blast. News4 reported in July that the officer said the explosion occurred as he tried to refill a butane lighter.

The charge Bartley is facing carries a maximum penalty of 20 years in prison.

Montgomery County Police assisted with the investigation, and the House Commerce and Science Committee launched its own probe. That committee has oversight over NIST.

"It's becoming clear we must better monitor those with access to our nation's high-tech research facilities," read a statement from the chairman of the committee in the aftermath of the explosion.

Building 236 remains closed, although it is available to scientific staff on an as-needed basis, Porter said.

"In response to the July 18 incident, NIST is identifying several external security experts with specific experience in protecting a research campus to conduct independent, individual reviews of NIST's current security posture, including staffing, processes, policies and procedures," Porter said. "NIST plans to use their recommendations to strengthen its security posture."

NIST, a federal entity that is part of the U.S. Department of Commerce, employs about 3,000 scientists, engineers and others on a 578-acre campus about 15 miles north of Washington, D.C.