A dog found with a severed leg after being hit by an MBTA commuter rail train is now recovering with a foster family, thanks to the quick work of a Good Samaritan and the MSPCA this week.

A worker performing maintenance on the line found a motionless one-year-old Shih-Tzu, now named “Charlie,” with its left hind leg completely severed from its body.

Shocked, the employee rushed the dog to the MSPCA’s Angell Animal Medical Center, where doctors removed what remained of her leg and also performed surgery to repair her crushed pelvis.

The dog lost about 40 percent of its blood and, and doctors said they were “astonished’ she survived, a statement from the organization said.

“She absolutely would have bled to death within hours had she not been brought in so quickly,” Dr. Virginia Sinnott of Angell’s emergency and critical care unit said in a statement. “

The dog had no identifying tags or chips. Well-wishers can help cover some of the costs of the $6,000 surgery via a donation page on the group’s website.

Charlie will remain in a foster home for a few weeks before she is ready to be adopted, but if you are interested in taking her into your home, you can contact adoption@mspca.org for more information.