Police received a report shortly after 10:30 a.m. of a burglary in progress in the 2100 block of 17th Avenue, police spokeswoman Johnna Watson said.
When officers arrived, they saw a man standing by the front door of a home armed with multiple handguns, Watson said.
Watson said the man pointed a gun at officers and shot at them, and that police returned fire.
No officers were hit, and the man fled, running into a nearby yard, Watson said.
Police set up a perimeter and began a search, and advised Roosevelt Middle School, located nearby at 1926 E. 19th St., to go into lockdown.
The suspect was described as a black man in his 20s wearing a white T-shirt and dark jeans.
As of 12:30 p.m., streets between 19th and 14th avenues and East 24th and East 21st streets were shut down.
SWAT officers were at the scene putting on protective gear, and a CHP helicopter was circling the area. Alameda County sheriff's deputies and Oakland Unified School District police were assisting.
Watson said all available Oakland police officers had been brought to the scene, and that police were only responding to 911 calls in the rest of the city.
Police confirmed at about 2:15 p.m. that the suspect had been taken into custody.