The dog became stuck on a ledge after roaming off leash

Heroes from the San Francisco Fire Department came to the rescue of a pooch stranded on a ledge on Wednesday, and it was all captured on camera.

It happened at the Golden Gate National Recreation Area, according to the San Francisco Chronicle, which reported the story. The dog, who was in the care of a dog sitter, took a tumble down a cliff after he went off leash, and became stuck on a ledge.

“That area is a leashless area. However, we recommend people remember that animals need to be within range for verbal commands, and people need to be responsible and keep their animals away from the cliffside,” Lt. Jonathan Baxter, a spokesman for the San Francisco Fire Department, told the Chronicle.

Watch the video in which a firefighter, held by ropes, brings the dog up to safety — and notice how bystanders watch the scene, a long, long way down on the sand below.

Baxter told the newspaper the dog sitter did the right thing by not attempting to rescue the pup from the ledge it was stuck on.

“A lot of times we will have an animal-person rescue and that’s because the companion will go down to attempt to rescue and get stuck, themselves,” Baxter said.