It happened just before 4pm Wednesday at Walden near Stewart.
Police were responding to the report of an apparent domestic dispute. When Lamont Cooper, 19, encountered the officers at the front door, he pulled a weapon and tried to flee out the back.
But he eventually headed back out front, where Cooper struggled with one of the officers.
"The suspect apparently reached for the weapon several times - even during the struggle with the officer, placing the officer in imminent fear for his life," said Dennis J. Richards, chief of detectives.
The still-unidentified officer fired his gun once, striking Cooper in the upper leg. Cooper was taken to ECMC, where he is under guard. His loaded gun was recovered at the scene.
Buffalo Police homicide and internal affairs are investigating, as is protocol whenever an officer is involved in a shooting.
Cooper is charged with three counts of assault and harassment, stemming from the original incident at the house. Additionally, he is accused of possession of a loaded weapon, resisting arrest, obstructing governmental administration and menacing a police officer.