Police officers trying to arrest a man ended up fatally shooting him and wounding one of their own after the man struggled and drew a realistic pellet gun.

Police were serving a robbery warrant for 20-year-old James Clay in an apartment at 2630 Victory Parkway in East Walnut Hills at about 3:40 p.m. Friday, according to Police Chief Eliot Isaac.

The officers knocked, but there was no response. Then an employee of Talbert House, which owns the building, helped the officers inside. They immediately encountered Clay, Isaac said.

Clay refused to cooperate, and one of the officers threatened to use a Taser, Isaac said. He said Clay grabbed one officer’s wrist. Police also played body camera which appears to show Clay lunge toward a second officer and pull a gun from his rear waistband.

The gun was actually a steel pellet gun, according to Isaac. But he said officers had no way of knowing that at the time.

“These officers very much sensed their life in danger,” Isaac said.

Clay charged Officer Ronald Schultz, according to Isaac. Then, Officers Stephen Bender and Thomas Wells drew their guns and opened fire, killing Clay.