A Maryland teenager has been charged with bringing a loaded, stolen .38 revolver to a high school in Montgomery County.

Montgomery County police said Elijah C. Nyamekye, 17, of Silver Spring is being charged as an adult in the incident at Paint Branch High School in Burtonsville.

They said the incident happened about 11:20 a.m. Tuesday when Nyamekye, who is not a student at Paint Branch, came into the facility. He got into the school by giving a fake name and student identification number, police said.

They said that Nyamekye fled the school and that a school resource officer searched the grounds for him but could not locate him. He was later found walking along Briggs Chaney Road near Columbia Pike.

He fled when the school resource officer tried to talk with him, police said. He was placed under arrest. In a search of his bag, police said, they found the loaded gun, along with a “small bag” of marijuana. Authorities said they later figured out that the gun had been reported stolen from Pennsylvania.

Nyamekye was charged as an adult with possession of a handgun, possession of a stolen handgun and other charges. He was released on bond, according to court records.

Capt. Paul Starks, a spokesman for Montgomery County police, said in an email that Nyamekye was “not a student” at the school and “did not belong on campus.” Police officials said they did not have a clear motive in the incident and are investigating.