Lucy, who won a national grooming contest, required hours of cleaning to remove dirt and matted fur.

When animal control officers found a dog abandoned in a cat carrier on a freezing night in New Jersey, rescuers could barely see the dog’s face. Her coat was so matted that rescuers couldn’t tell her sex or breed, and a veterinarian shaved a portion of fur just to reach the dog’s skin with a needle.

Kimberly Callea, the Easel Animal Rescue League’s shelter manager, took her in and sent her to pet groomer Yahaira Sosa in Ewing Township, New Jersey, to remove the dirt and matted fur that had accumulated for months or maybe even years. After about three hours of grooming, rescuers were shocked to see that the dog, whom they named Lucy, was a six-pound Havanese with gray and white fur.

On Wednesday, her dramatic transformation was celebrated when she won top prize in the Wahl Dirty Dogs Contest, a national shelter makeover competition that awards grants to the groomers and shelters that clean up rescue dogs and help them find homes.

“Looking at [her] today compared to when she first arrived is almost hard to believe,” said Callea. “She went from barely surviving to truly thriving.”