Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An unidentified passer-by pulled a driver to safety after his vehicle struck shrubs and a tree and then hit a chain link fence on the edge of a 30-foot vertical drop in Lewiston, Idaho, on Wednesday morning.

Mathew Sitko, 23, was taken to a hospital with minor injuries after the Good Samaritan smashed the passenger window of his 2000 GMC Yukon with a rock and pulled him to safety, according to NBC News affiliate KHQ.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Lewiston interim police chief Roger Lanier told NBC News that the Good Samaritan had a brief conversation with the officer who arrived at the scene, then left without identifying himself.

Sitko's accident was apparently triggered by "some sort of mental or emotional episode," Lanier said.

"What he told the officers was he was literally driving along after dropping off his younger siblings for school, and he was listening to a song on the radio, and some lyrics in the song convinced him that it was essentially his time to die," he said. "He just closed his eyes, took his hands off the wheel, and pressed the accelerator."

The fence kept him from flying off the cliff, Lanier said.

"He was treated for his injuries, which were minor, but he's also being treated for some mental health issues."

The Good Samaritan smashed the passenger-side window to free Sitko from the car, Lanier said.

— Elizabeth Chuck and Jon Sweeney