Officers attempted to detain the male, an Oakland resident, for public urination in the 2100 block of Fruitvale Avenue at around 7:40 p.m.
Police said the male became violent, assaulted an officer, and attacked the officers with a long, metal blunt object.
An officer pulled out her firearm and shot the suspect to defend the officers, according to police.
The suspect was taken to Alameda County Medical Center for his injuries and is expected to survive.
An officer was also injured during the incident. She was taken to Summit Hospital and was treated and released.
Anyone with information regarding this incident is asked to call the department's homicide section at (510) 238-3821.