BLACK HILLS, S.D. (KELO)– A young man was not hurt after being rescued from a Black Hills cave last weekend.

Custer County Search and Rescue said it happened between Friday, Oct. 7, and Saturday Oct. 8. A group was exploring a cave on private property when a young man was following an unexplored passage and got stuck, search and rescue said.

Search and rescue said the man’s companions tried to rescue him. The man was 40 minutes from the entrance.

Drills were brought in to widen the passage, and webbing was passed to him and he was able to pull himself free after 18 hours. After reaching a larger room, he was able to crawl out of the cave.