The standoff started at a home in the 2500 block of East 23rd Street near 25th Avenue, Oakland police spokeswoman Cynthia Perkins said.
It ended shortly after 8:30 a.m. when the man came out and was arrested with the assistance of a bean bag weapon fired by an officer, Perkins said.
The man's shotgun was also taken into custody, she said.
Perkins did not know what preceded the standoff or whether the man fired the gun, but a neighbor who lives on East 23rd Street said she heard shots fired around 4 a.m. and then later saw police swarm her street.
The woman, who did not want to give her name, said she was planning on going to the gym early this morning but heard the shots and "didn't leave my house because I knew it had to be close by."