Antoine Harris, 20, of Oakland, walked into the Oakland Police Department's Eastmont Substation at 2 p.m., Oakland police spokesman Officer Jeff Thomason said.
Harris was arrested and taken to the criminal investigations division for questioning, Thomason said.
Police believe Harris shot a 21-year-old Oakland man near a supermarket at 76th Avenue and MacArthur Boulevard about 1:20 p.m. Friday, then ran and hid in an apartment building two blocks away.
Police and Alameda County Sheriff's SWAT team members surrounded the building. After a search that lasted until 2 a.m. Saturday, tactical officers determined Harris was not inside.
The apartment building at 2755 74th Avenue is the same place where two Oakland SWAT officers were killed in a separate shootout with another barricaded gunman in March.
The victim in Friday's shooting is recovering at a local hospital in stable condition, according to police. It is not yet clear what relationship, if any, Harris had with the victim.
Anyone with information about the shooting is asked to contact the Oakland Police Department's assault section at (510) 238-3426.