Three police officers and a bystander brought a man back from the brink of death after a motorcycle crash in Miami County, Indiana, on Wednesday.

The Indiana State Police said two state troopers and one deputy from the Miami County Sheriff’s Office were called to the crash site on US 31 near Miami County Road 900 South a few minutes after 8:00 p.m., WTHR reported.

“They arrived to find a passerby performing CPR on 48-year-old William Lidy of Russiaville, who was in a ditch off the east side of the road, next to a motorcycle,” the outlet said.

Trooper Andrew Baldwin and Sgt. Andrew Smith realized Lidy was turning purple, was not breathing, and they could not find a pulse.

“The officers took over the CPR from the good Samaritan. Miami County Sheriff’s Deputy James Bean arrived on the scene and assisted Smith and Baldwin with CPR,” the Indiana State Police said in a press release.

Moments before medical crews arrived, Lidy began breathing and regained his pulse. In addition, Baldwin and Smith applied an automated external defibrillator (AED) to the motorcyclist.

“It advised no shock was needed. Lidy was transported by ambulance to a local hospital. He was then flown, via medical helicopter, to an Ft Wayne hospital. At last check, he was in stable condition and expected to make a full recovery,” the press release stated.

The crash investigation by Baldwin found Lidy was driving a 2006 Honda CBR motorcycle northbound and for an undetermined reason, the motorcycle went off the east side of US 31 and ejected him.

“The investigation is ongoing. The use of intoxicants is suspected of having contributed to the crash. Lidy was wearing a helmet which Baldwin believes helped reduce the severity of his injuries,” the state police’s news release said.

Facebook users praised the officers and those who worked to save the man’s life.

“Talk about your guardian angels being with you at the right time & the right place…You Matter…” one person commented.

“Good job to all involved to help this man,” another wrote.