"He was located just outside Union City in the city of Hayward," said Captain Travis Souza.
Souza says police arrested him at the Mexico Super off Mission Boulevard.
Union City Police say the suspect, who is a minor, could be facing serious charges.
"Depends on the gravity of the injuries but could be facing attempted murder," said Souza.
James Logan High School's Spokesperson says the victim was stabbed in the stomach and required surgery. He also says there are seven to nine security guards on campus for 3,600 students, but none of them were around when the stabbing occurred outside a school building on campus.
"Much like the police department can't be everywhere in Union City, our campus supervisors aren't everywhere at any one given time," said John Mattos who is the district's public information officer.
The suspect nicked a second student with his knife but that student didn't go to the hospital. The school spokesperson says both victims walked themselves into the main office.
"Obviously it's upsetting, it's very upsetting, but I do think that Logan is a safe campus," said Mattos.
As parents received word, many of them came to the school while it was still on lockdown, desperate to know if their children were okay.
"Worried and scared because this used to be a good school so now we're not safe nowhere," said parent Lorena Velasco.
Father Omeed Abed told ABC7 News his daughter knows the stabbing victim.
"My daughter is in the class chatting with me and she's crying, praying for him to be okay," said Abed.
The suspects' family did not want to comment.
School officials say he'll be dealing with law enforcement before facing disciplinary action.
Police have not said if the knife was recovered or what type of knife it was.
Hearing suspect is in custody. Lockdown lifted— Melanie Woodrow (@MelanieWoodrow) February 22, 2019
Ongoing police activity here at James Logan. One student stabbed and one student (suspect) missing. pic.twitter.com/tN7NfH7ALH— Melanie Woodrow (@MelanieWoodrow) February 22, 2019
Update: one male student stabbed three times transported by ambulance per staff member here pic.twitter.com/JGkfFOjpsu— Melanie Woodrow (@MelanieWoodrow) February 22, 2019
Breaking: James Logan HS on lockdown following school stabbing. Suspect is a student & has been identified to staff. Police have not officially released his name. I spoke with suspect’s mom by phone who says she can’t reach her son and doesn’t know what precipitated incident pic.twitter.com/GsRva9IqpX— Melanie Woodrow (@MelanieWoodrow) February 22, 2019