TAMPA, Fla. (WFLA) — A dog was rescued after spending three days trapped in a Tennessee cave with a sleeping bear.

The Waldens Creek Volunteer Fire Department posted the video on Oct. 11 of crews rescuing the dog, named “Charlie” who had fallen 40 feet into a narrow cave shaft.

As two firefighters descended into the mouth of the cave to get the dog, they discovered a 2-year-old, 200-pound bear sleeping five feet from one of the firefighters. The dog was even further down the cave.

Crews got out of the cave and trial cameras were placed to monitor the cave exit to signal when the bear left.

The following day, the bear had seemingly left, leaving an opportunity for crews to rescue the dog.

Firefighters entered the cave on a rope system, descended down, fashioned a harness for the dog, and rescued Charlie, who was dehydrated and hungry.

Charlie was reunited with his owner.

“We would like to thank and recognize the entire rescue team and people who worked together to make this happen,” the department wrote on Facebook. “It was truly a team effort that required all these departments to make it a success.”