A teenage gunman in California shot a 16-year-old student two times outside their high school Tuesday morning then showed up in class after the violence.

The shooter, a 17-year-old boy, blasted the younger victim twice in the upper body, seriously injuring him, just before 9 a.m. on the sidewalk outside Ridgway High School in Santa Rosa.

The shooting prompted a massive lockdown at the sprawling campus — which houses three high schools and more than 10,000 students.

The lockdown was lifted several hours later after authorities picked up the teen in a classroom, charging him with suspicion of attempted murder.

Following the shooting, the gunman placed his handgun inside a backpack and passed it off to somebody else, according to Santa Rosa Police Capt. John Cregan.

It’s unclear if the other person, who police are still trying to track down, knew the bag contained a gun.

Authorities believe an argument between the two students preceded the shooting.

The victim was taken to a nearby hospital and is listed in stable condition.

With Post wires