Ridgeway High School students are led back to their classes after the arrest of a suspect who opened fire from on another student across the street from the high school , Tuesday, Oct. 22, 2019 in Santa Rosa, Calif. (Kent Porter/The Press Democrat via AP)

SAN FRANCISCO (AP) — A 17-year-old boy gunned down another student outside their school Tuesday, ditched his gun and slipped into a class without arousing suspicion, evading capture for almost two hours as he joined thousands of students locked down inside classrooms because of the shooting, police said.

The teen was arrested in a gym class by officers who used surveillance video to track him after he shot and wounded a 16-year-old boy, then handed his gun in a backpack to someone in a car.

"It's disturbing to see that he was able to go right around to his normal business," police Capt. John Cregan told The Associated Press. "It's a scary situation."

The two teens got into an argument before the gunman shot the victim twice. He fell but was able to get back up and run to a car that took him to the hospital, Cregan said. He was in stable condition.

Police don't know if the person who took the backpack and drove away knew a gun was inside. They're investigating whether the shooting was gang related.

More than 10,000 students and staffers in a complex with three schools were locked down after the shooting outside Ridgway High School in Santa Rosa, north of San Francisco.

The shooter was "behaving normally," following lockdown protocol by going to the nearest classroom after the shooting. The gym teacher and other students didn't realize he was the gunman, Cregan said.

Witnesses told police the shooter fired three to four rounds before fleeing, authorities said. Dozens of students were in the area at the time. The suspect was booked into juvenile lockup on suspicion of attempted murder. His name wasn't released because of his age.

Panicked parents got text messages and worried about their kids' safety. Cherie Posluszny said her 17-year-old daughter texted that someone got shot.

A minute later, the girl texted, "I love you," followed by another message before her phone stopped working. She then used a friend's phone, and her mother asked if she was OK.

"Not really. But I will be OK," her daughter responded. The girl said she spent hours lying on the cold floor hiding behind a teacher's desk with other students.

Posluszny said she worried how this "new normal" was affecting children.

"This is becoming routine. It's part of the culture now. These kids are also victims," she said as she raced to the school.

Police said the shooting was originally reported on the Ridgway High campus just before 9 a.m. but later said it happened on the sidewalk just outside the school, which does not have metal detectors.

It is part of a sprawling complex that also includes Santa Rosa High School, Santa Rosa Junior College, school district offices and athletic fields. The complex with thousands of students, teachers, administrators and others was locked down as a SWAT team searched for the gunman, Cregan said.

Santa Rosa police, who are getting help from the FBI, lifted the lockdown around 11:30 a.m. following a thorough sweep of the schools.

Ridgway High, about 55 miles (89 kilometers) north of San Francisco, is an alternative continuation school for Santa Rosa High.

___

Dazio reported from Los Angeles. Associated Press writer Jocelyn Gecker contributed from San Francisco.

___

This story has been updated with new information from police that the shooting happened near the school, not on campus, and that the victim was 16, not 17.

Santa Rosa police officers hold guns as they search the campus of Ridgway High School for suspects after a shooting at the school in Santa Rosa, Calif., Tuesday, Oct. 22, 2019. (Beth Schlanker/The Press Democrat via AP)
Xiomara Martinez, left, embraces her sister Alondra Moya after Moya and other students were released from a lockdown after a student of Ridgewway High School in Santa Rosa, Calif., was arrested for shooting another student across from the high school Tuesday, Oct. 22, 2019. (Kent Porter/The Press Democrat via AP)
Brandon and Jessica Bayer, waiting for news of their son Andrew, 17, stand with student Jackelyn Strange, 17, left, and parent Blair Benson, right, as Santa Rosa police search the campus of Ridgway High School for suspects after a shooting at the school in Santa Rosa, Calif., Tuesday, Oct. 22, 2019. (Beth Schlanker/The Press Democrat via AP)
Santa Rosa police officers carry guns as they search the campus of Ridgway High School for suspects after a shooting at the school in Santa Rosa, Calif., Tuesday, Oct. 22, 2019. (Beth Schlanker/The Press Democrat via AP)
Police officers search for a suspect in a shooting at Ridgway High School in Santa Rosa, Calif., Tuesday, Oct. 22, 2019. (Beth Schlanker/The Press Democrat via AP)
Law enforcement personnel start their search for a gunman that shot another student across from Ridgeway High School in Santa Rosa, Calif. Tuesday, Oct. 22, 2019. (Kent Porter/The Press Democrat via AP)
Ridgeway High School students are released from classes after the arrest of a suspect who opened fire on another student across from the high school, Tuesday, Oct. 22, 2019 in Santa Rosa, Calif. (Kent Porter/The Press Democrat via AP)