The 8-year-old beagle mix, injured after she and her owner were hit by a car in Dorchester, limped to a nearby dentist’s office and barked repeatedly in a presumed plea for help, said local veterinarians and the man’s family.

Lucy then returned to the side of a barely conscious John Miles, refusing to leave him, even as he was loaded into an ambulance.

Miles, 66, suffered two broken legs, a broken arm, and 15 facial fractures. He is recovering at a local rehabilitation center, officials said. Lucy suffered a torn ligament in her rear right leg.

The two were on their daily walk last month when a car struck them as they crossed Neponset Avenue, said Miles’s daughter-in-law, Caitlin.

When authorities arrived, Miles had no identification. Officials used the address and phone number on Lucy’s identity tags to locate his family.

Caitlin Miles rushed Lucy to the MPSCA Angell Animal Medical Center, while her husband and mother-in-law went to see John Miles in the hospital. Surgery to repair Lucy’s leg was a success.

On Saturday, she went home to a hero’s welcome.

“It was just incredible that Lucy went right into action instantly to get help,” Caitlin Miles said.

Then again “she’s always been a really good, loyal dog,” she added. “John takes her for a walk every single day, and when he’s around the house, she always follows him around.”

The family has seen an outpouring of support. More than $25,000 was raised through an MSPCA website to pay for Lucy’s medical costs. The remainder will go into an SPCA fund for pet owners facing expensive bills and to cover the cost of caring for homeless animals and those seized in cruelty investigations.