A former federal security official accused of making methamphetamine inside a highly secured government research facility and causing an explosion pleaded guilty Friday.

Christopher Bartley, a police lieutenant for the National Institutes of Standards and Technology (NIST), reported to work July 18 and that evening went into a room where he could make meth under a chemical fume hood, according to his plea agreement. The explosion he caused about 7:30 p.m. blew four shatterproof windows out of their frames, sending them 22-33 feet from the building.

Bartley suffered burns on his arms and singed eyebrows and hair, according to the U.S. attorney.

The blast sent the temperature to 180 degrees, and a silent heat alarm activated. Responding firefighters saw Bartley leaving the room, according to the U.S. attorney. He took items from the scene and dumped them in trash near the building and at another NIST building.

Investigators searched the room and the trash and found equipment and household items for making meth. In Bartley's car they found a recipe and more equipment.

His attorney, Steven Van Grack, said Bartley was conducting an "unauthorized training experiment" at the time of the incident that "clearly failed." Bartley was trying to show how easy it is to make meth, Van Grack said.

The U.S. attorney said there's no evidence it was a training exercise and drug enforcement isn't part of Bartley's job.

A federal prosecutor in Greenbelt charged Bartley, of Gaithersburg, with attempting to manufacture methamphetamine.

Van Grack said earlier this week that he was 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.

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, where the explosion occurred, remained closed, although it is available to scientific staff on an as-needed basis, Porter said Tuesday.

"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.