Police were searching for a suspect who had fled from a traffic stop near the corner of Eighth and Delaware streets at 10:40 p.m.
The officers saw the suspect in an apartment. He came out of the apartment and opened fire on the officers, police said.
Police returned fire, hitting the suspect in the arm and leg.
He was taken to a hospital to be treated for injuries that were not life-threatening, police said. No officers or bystanders were injured.
The officers involved have been placed on paid administrative leave as equired by department policy, and the case is being investigated by Berkeley police and the Alameda County District Attorney's office.