A dramatic rescue in Colorado after a hiker got stranded alone on a precarious ledge at 13,000 feet.

19-year-old Canadian Samuel Frappier was hiking Longs Peak in the Rocky Mountain National Park with a friend Tuesday.

But according to KCNC, "They got separated, and he got trapped trying to find a quicker way down the mountain, almost falling off a sheer cliff with a thousand-foot drop. He ended up sleeping on the mountain overnight, completely exposed."

Frappier somehow got stuck in a position where he couldn't go up or ​down. He says had he slipped just a few feet, he would have fallen to his death.

He didn't have much food or water, but he did have his cell phone, which he used to contact park rangers. According to The Denver Post, "by the time the rescue effort was finished, 28 team members and several helicopters were involved."

Officials told KDVR Frappier was in good shape despite spending the night in the cold without proper gear. He told KMGH he feels incredibly lucky to be alive.

"I imagine people saying I'm stupid, and they're right. It was stupid, and I'm never going to do that again," said Frappier.

Frappier spent the night in a hotel, then planned to go straight home to Quebec. Park officials say all those involved in the rescue returned home safely.

See more at newsy.com.