An Australian shepherd named Seamus is lucky to be alive after he was suddenly swept away by floodwaters in California only to be reunited with his owner just hours later thanks to a dedicated fire department and an Apple AirTag that helped locate him.

Seamus was out for his daily walk along with his owner, Emilie Brill, when he managed to get away from her and found his way to the edge of a flood control basin near the intersections of I-215 and I-10 in San Bernardino, California, on Monday, according to San Bernardino County Fire officials and ABC News’ Los Angeles station KABC.

“He got away from me and he just went down into this drainage and, you know, the water was going so fast, I think all it took was one paw in that water and he was gone,” Brill told KABC following Seamus’ rescue.

Brill called the emergency services as soon as Seamus was swept away and crews were immediately dispatched to the area to assist.

When crews arrived they began to canvass the area but were flagged down shortly after by an employee at a local RV facility who told them that he had “heard a dog barking in the nearby channel and witnessed the dog floating down the channel,” according to a statement from San Bernardino Fire.