A 12-year-old girl shot two classmates — critically wounding one — inside a Los Angeles middle school Thursday morning, cops said.

The two victims — a male and female, both 15 — were shot in a classroom at Salvador Castro Middle School in Westlake around 8:55 a.m., the LA Times reported.

The teenage boy was shot in the head and was in stable but critical condition at an area hospital. The girl was in fair condition after being shot in the wrist, according to a tweet by the LAPD.

Three other people, ranging in age from 11 to 30, also suffered minor injuries, but were not shot, Los Angeles Fire Department Capt. Erik Scott said in a press conference at the scene.

Police took the alleged shooter into custody immediately after the incident and the weapon was recovered at the scene, the LAPD tweeted.

“What I want to say is, as a parent, this is everyone’s worst case nightmare — worst case scenario and a nightmare for all of us,” commanding officer for the LAPD’s Operations-Central Bureau, Robert Arcos, said. “The surrounding community, our parents who are watching should be assured that their kids are in great care.”

Arcos said police are working to determine the motive or how the student accessed the firearm.

Both schools remained on lockdown after the incident. Students were being taken from the classroom in handcuffs and patted down by police before they were released to their parents, the report states.