Officers were called to the 400 block of Grant Street around 11:30 p.m. Tuesday, according to Oceanside police Lt. Leonard Mata.
The victim, who is documented gang member, was taken to a local trauma center, Mata said, noting the man was expected to survive.
Officers saw the 16-year-old suspect running from the scene, along with several other juveniles. Mata said the officers caught up with the boy and arrested him for the shooting.
The teen is known to have gang ties, according to Mata. He was booked into Juvenile Hall on suspicion of attempted murder and participation in a criminal street gang.
Anyone with more information about the shooting was asked to call Oceanside police Detective Mark LaVake at (760) 435-4872.