WATCH: Firefighter rescues 12-year-old dog struggling to swim

On Thursday, the nearly 12-year-old Chinese Shar-Pei and Rottweiler mix got lost from his Miami Beach home, fell into Biscayne Bay, was rescued by a firefighter and later was reunited with his owner thanks to some social media magic.

The rescue and reunion were posted on the Miami Beach Fire Rescue's Twitter page.

By then, firefighter Emilio Sanchez had spotted the dog struggling to swim in the water behind a home about a block from its home. Sanchez jumped in and helped the 50-pound dark-haired dog to shore with an assist from other firefighters.

"He was very exhausted, just by the way he was breathing, and he was already barely able to keep his head up out of the water," Sanchez told WPLG. "So I pretty much got there in good timing. He was very eager to see me and he was happy I was there."

Firefighters dubbed Junior "Champ" before handing him over to police.

A woman who runs a pet-reuniting service in Los Angeles helped to reunite the dog and his owner after spotting news reports about Junior and seeing Ruiz's Instagram post. Helen Trimble contacted Ruiz and sent him the stories. He headed to City Hall, where he was reunited with Junior.