A multi-agency search Thursday in China for a mentally ill man ended with his safe discovery.

Deputy Chief Ryan Reardon of the Kennebec County Sheriff’s Office said the search began shortly after noon when deputies were called to check on a 25-year-old man with a mental health problem. His name was not made public.

Crisis & Counseling Centers had asked that the man, who has several diagnosed illnesses, to be taken to the hospital for treatment, Reardon said.

The man fled from his Pleasant View Ridge Road home before sheriff’s deputies arrived. The man remained in the woods for several hours, at points calling his father to say that he was cold, but also avoiding the deputies who searched for him, Reardon said. The Maine Warden Service was eventually called to assist with the search.

The man was taken into protective custody shortly after dark, around 5 p.m., when he emerged from the woods onto a road. He was taken to MaineGeneral Medical Center.

Reardon said the happy ending was a relief.

“Given the temperature and his mental state we weren’t going to give up until we got him,” he said.