The shooting was reported at 3:55 p.m. in front of Fremont High School, located at 4610 Foothill Blvd., police said.
The boy, a 17-year-old Fremont High School senior, was hit in the leg, and was conscious and able to provide police with suspect information, Oakland Unified School District spokesman Troy Flint said.
He was taken to Children's Hospital in Oakland and is expected to survive his injuries, Flint said.
The shooting occurred across the street from the school around the time classes were being dismissed, Flint said.
A suspect in a hooded sweatshirt was seen running away from the scene, Flint said.