Kendrick Roby was arrested on suspicion of the robbery, which was reported at about 11:05 a.m. Monday at the BBVA Compass Bank at 660 Woodside Rd.
A suspect entered the bank and jumped over a counter and demanded money from employees, threatening to shoot them if they did not comply, police Sgt. Sean Hart said.
The suspect then opened a drawer and took cash from it and then fled from the bank, running north on Oxford Street, according to police.
A witness reported seeing the suspect run into an apartment complex in the 1500 block of Oxford Street.
Officers eventually found the suspect, later identified as Roby, hiding in an apartment complex in the 1500 block of Hudson Street and took him into custody, police said.
The stolen money was recovered but no weapon was found on Roby despite his threat to shoot the bank employees, Hart said.
No one was injured during the robbery.
Anyone with information about the incident is asked to call Detective Ed Feeney at (650) 780-7129 or Detective Dave Stahler at (650) 780-7620.