Rex and Javier were home alone on Wednesday afternoon when two thieves broke in. Frightened, Javier then ran upstairs and hid in a bedroom closet while on the phone with police, as Q13 Fox News reports.

As Javier's aunt later wrote online, the dog confronted the intruders — who responded by attacking him. The dog then retreated, though he wasn't out of fight.

"Rex stormed back to the upstairs floor all beat up and bloody from the beating to check on his master who was still hiding in the closet," Susy Cadena wrote. "Soon, the burglars proceeded to the upstairs floor and trashed all the bedrooms. As they entered the room where my nephew was hiding in the closet, Rex came out with the little strength he had left in him and threw himself at them as he knew my nephew was in danger."

The thieves then shot at Rex, striking him at least three times. They then fled the scene, leaving Javier unharmed.

Once authorities arrived, Rex was then rushed BluePearl Veterinary Clinic in the town of Renton. He was stabilized, but would require surgery to be saved — an expensive procedure Rex's family couldn't afford on their own.

And that's when hundreds of strangers stepped in to help.

Cadena started a GoFundMe page with a goal of $10,000 to cover Rex's medical costs. In a few short days, more than $60,000 in donations has been collected.

"Thanks to God, Rex is doing much better," Rex's family told The Dodo. "It's going to take a lot of therapy, time and lots of love from all of us for him to go back to be the sweet dog he used to be. But don’t doubt for a minute that we will do everything in our power to help him get there soon."