A teenager shot a fellow student outside of their Northern California high school on Tuesday morning, then got rid of the weapon and went back to class, police said.

A 17-year-old boy was arrested on the campus of Ridgway High School in Santa Rosa, about 60 miles north of San Francisco, and booked on suspicion of attempted murder, Santa Rosa police Capt. John Cregan told reporters.

A 16-year-old boy was shot twice "in the upper body" and showed up to a local hospital on his own, according to Cregan. The victim is expected to survive his wounds.

The shooting happened a little before 9 a.m. local time in front campus at the corner of Ridgway Avenue and Morgan Street, authorities said.

Police announced lockdowns, at 9:12 a.m., at Ridgway HS, and nearby Santa Rosa HS and Santa Rosa Junior College. By 10:38 a.m. police announced they had detained a possible suspect and the lockdowns were lifted by 11:33 a.m. as classes resumed, officials said.

The two Ridgway students were arguing when one pulled the gun and opened fire, Capt. Cregan said. The shooter then stashed the gun in a backpack and gave that bag to another student who unknowingly took it away, police said.

"We have no understanding at this point that this kid understood what was in that backpack," Cregan said. "We just have evidence to believe a vehicle left that area with a backpack containing (the gun)."

Police said finding that gun is a top priority.

"It's a priority for us to be able to locate this hand gun and get it off the street to make sure that no one else is injured," Cregan said.

The suspect returned to campus after shooting before he was eventually captured by responding officers, police said.