A miracle dog who was sucked away in a deadly Alabama tornado crawled back to the ruins of his owners’ home with two badly broken legs nearly three weeks later, wagging his tail with joy at the sight of his shocked family.

The owners, who lost nearly everything in the twister that devastated North Smithfield on April 27, burst into tears upon seeing their dog, Mason, perched on what was left of their front porch.

Now the 1-year-old terrier mix is on the yellow brick road to recovery after undergoing surgery to fix his legs.

“He’s doing great,” said Dr. William Lamb, the Birmingham vet who has been tending to Mason for free since the pup was found on May 16.

Mason will be returned to his owners, who want to remain anonymous, in a few weeks.