BATTLE CREEK, Mich. (WOOD) — A man who fired a Battle Creek officer’s gun while it was in its holster during a mental health crisis has been charged, police say.

Brian Lamont Armstrong, 49, has been charged as an habitual offender with three counts of resisting and obstructing police, assault with a dangerous weapon and attempting to disarm a police officer, the city of Battle Creek said in a Wednesday release.

On May 26, two officers with the Battle Creek Police Department responded to the intersection of Wabash Avenue and Capital Avenue. Armstrong was dancing in traffic and was trying to be hit by cars, city officials say.

The two officers determined he was having a mental health crisis. They told him they want to help and tried to de-escalate the situation before they decided to take him into protective custody so that they could take him to the hospital, the city said.

In bodycam footage from both officers released by the city Wednesday, which contains profanity, Armstrong is heard telling the officers, “they’re trying to kill me,” as they approached him.

The officers told the Armstrong they wanted to help. They told him to get out of the road and told him to take a deep breath.

“We’re not going to take you to jail man, we’re trying to help. We’re trying to help you,” one of the officers is heard saying in the bodycam footage. “We’re the only two here.”

Later, the officers ask for his address and tell him they’re going to drive him home.

“We’re going to give you a ride, I don’t want you to get hit,” one of the officers is heard saying.

“We’re either going to take you home or I’m going to take you to the hospital, what do you want?” the second officer is heard saying.

The man started walking toward the road again and the officers tried getting the man into custody.

Bodycam footage shows a struggle between the officers and Armstrong.

“Stop, stop,” one of the officers says while trying to hold Armstrong down and then a gun is heard going off.

“Ow!” the officer said. “He’s got my gun.”

Footage shows Armstrong’s hand on the grip of the gun.

The city said he tried to take the officer’s gun and pulled the trigger. The gun shot through its holster.

“We’ve got him pinned down, he got my gun, pulled the trigger. I’m not hit, just a graze,” the officer is heard telling someone on scene.

They eventually got Armstrong into handcuffs, which is where the footage ends.

The bullet grazed the officer’s leg, officials say. They say the officer was brought to a local hospital with a minor injury.

News 8 is not releasing the name of the two officers as they have not been charged.

Armstrong was not injured and will receive mental health care, the city says.