A police officer shot and killed a man suspected of stealing from cars who the police said shot at them first in Temple Hills, Maryland, on Monday morning.

WASHINGTON — A police officer shot and killed a man suspected of stealing from cars who the police said shot at them first in Temple Hills, Maryland, on Monday.

The shooting happened in the 3000 block of Brinkley Road, north of Henson Creek Park, in Temple Hills, Prince George’s County police said.

Police have identified the man killed as Jose Alvarez, 23, of Woodbridge, Virginia.

Around 7:30 a.m., an officer was called to the apartment complex at 3300 Huntley Square Drive after someone said they saw a person stealing things from a car, police Chief Hank Stawinski said Monday morning.

The officer saw the suspect, who ran across the street and hid in a laundry room in an apartment building on Brinkley Road, in the Henson Creek Apartments, shedding two license plates he’d hidden in his pants along the way, Stawinski said.

The officer called for backup, and they began searching the building. They eventually found the suspect in a laundry room, trying to hide behind a laundry machine, Stawinski said.

The suspect didn’t comply with the officers’ commands to come out and stand up, Stawinski said, and a struggle ensued. Officers tried to use a stun gun on the suspect, but it didn’t work and he pulled out a gun.

Stawinski said the suspect got a shot off, and an officer grabbed at the gun in such a way to prevent it from firing again, suffering “significant injuries” to their hand. An officer then shot the suspect, who was pronounced dead at the scene.

“All that happened in the course of about a second,” Stawinski said. He added that the officer who grabbed at the gun “likely [saved] the lives of one or more officers.”

In a Monday night news release, police said Alvarez fired his weapon twice and the officer fired once. Alvarez’s weapon was recovered in the laundry room, police said. Police have also released cellphone video from a resident in which gunshots could be heard prominently in the background.

The officer who shot Alvarez is on administrative leave pending the outcome of the investigation.