A Woodrow Wilson High School student suspected of carrying a semiautomatic handgun into the school, then into a classroom on Tuesday had flashed the weapon in a hallway and then put it into another student’s backpack, according to a D.C. police report made public Wednesday.

The report says a student saw this chain of events and notified the classroom teacher, who called police. Officers arrested the student who allegedly put the black gun in the bag, according to the report, which provides additional details about the incident that frightened parents in one of the District’s highest-performing schools.

School and police officials said they are continuing to investigate how the weapon got into the school and breached security that includes metal detectors at the main entrance.

Michelle Lerner, a spokeswoman for D.C. Public Schools, said that school video footage shows that the student who was apprehended with the gun had gone through a metal detector Tuesday morning. Lerner also said that the bag went through an X-ray machine, but it was not immediately clear whether she meant the bag the gun was found in or a bag used by the student who was arrested.

A D.C. Superior Court judge on Wednesday ordered the teen to be housed with the Department of Youth Rehabilitation Services until his next hearing. The teen was charged as a juvenile with carrying a dangerous weapon, possession of an unregistered firearm and unlawful possession of ammunition.

The incident occurred shortly after 1 p.m. at the high school in the 3900 block of Chesapeake Street in the Tenleytown neighborhood of Upper Northwest.

The police report says that a student saw another student display a handgun, then enter a classroom. The witness also saw the student “place the described handgun inside a school bag” belonging to another student, the report says. After the witness told a teacher about the incident, the teacher notified authorities.

Police confiscated the weapon from the bag and arrested the student who was seen putting it inside, the report says. A picture showing what appears to be a student with a gun on his lap was briefly posted online and then deleted; Wilson students and their parents were e-mailing the image to one another after the incident and saying they believed it was connected, but The Washington Post has been unable to determine whether the image is authentic or where it was taken.

Kim Bayliss, president of the Wilson High School parent-teacher association, said the incident raised numerous troubling questions.

“The main thing people want to know, with all the alleged security that we have in the building, is how did this get into the school?” Bayliss said, noting that metal detectors and an X-ray machine, along with security guards, at the front entrance have prevented students from bringing in items such as glass containers and forks to use at lunchtime.

Parents are questioning whether security was compromised because of cuts to staffing last year, she said. Bayliss and students noted that there are numerous entrances to the school and that although the doors are locked, they can easily be opened from the inside by students.

The school’s principal, Kimberly Martin, wrote in an open letter to the community Tuesday evening that officials inspected “all of the more than 50 first doors/entrances” to the school and are “increasing our daytime coverage of doors during school hours.”