BATTLE CREEK, Mich. (WOOD) — A Battle Creek police officer received a minor injury when he was shot while responding to a mental health incident Thursday, city officials say.

It happened around 4 p.m. at the intersection of Wabash Avenue and Capital Avenue NE.

A 49-year-old man was dancing in traffic and was trying to be hit by cars, the city of Battle Creek said in a release. Officers with the Battle Creek Police Department arrived and determined the man was having a mental health crisis.

They told the man they wanted to help and tried to de-escalate the situation.

He “continued acting and speaking irrationally,” so officers tried to take him into protective custody so that they could take him to the hospital, the city said.

The man started to fight with the officers and there was a struggle. The city said the man tried to take a gun from an officer and in doing so pulled the gun’s trigger.

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

The man was not injured and officers were able to take him into custody, the city said.

Officials say he was brought to the Calhoun County Jail and will all receive mental health care.