A dog stranded on an aqueduct in Phelan was saved thanks to San Bernardino County Fire crews.

Crews received a report of a swift water rescue involving a dog trapped on the aqueduct on Wednesday, the department said. While executing an aerial search for a missing person, a San Bernardino County Sheriff’s Aviation helicopter saw the pooch and alerted dispatchers.

The rescue team then immediately headed to the location where the dog was spotted and worked to save it. Video of the rescue showed crew members calmly approaching the dog as water levels reached its paws.

After securing a harness on the dog, crews were able to successfully lift it to safety and out of the aqueduct. The pooch was not harmed during the ordeal.

“This rescue highlights the adaptability of our firefighters and the importance of interagency coordination,” Battalion Chief Sean Solis said in a statement. “We are grateful for the Sheriff’s Aviation crew spotting the animal and helping us bring it to safety.”

It’s unclear how the dog got onto the aqueduct.