A Battle Creek, MI, police officer was shot in the leg Thursday after a man was able to pull the trigger of his service weapon during a struggle.

Police say officers responded to a man dancing in traffic and intentionally trying to be hit by passing cars. The officers who arrived determined he was having a mental health crisis and tried to de-escalate the situation by letting the man know they wanted to help him.

The man continued acting and speaking irrationally, and officers decided to take him into protective custody and take him to the hospital for evaluation. He would not go willingly. Instead, the man resisted and fought with the officers.

During the struggle, he reportedly tried to take an officer’s gun and was able to pull the trigger. Police report the gun shot through its holster. The shot grazed the officer’s leg, causing a minor injury.

The officer was treated at an area hospital and the dancing man was placed into the Calhoun County Jail, pending charges. Police say he also will receive appropriate mental health care.