Dan Tillery and Diggy This jubilant selfie immediately went viral ... and that's when the trouble began. (Photo: Detroit Dog Rescue/Facebook)

Stay, Diggy, stay. After a three-month battle with local officials, a town hall meeting packed with supporters, and a petition signed by more than 111,000 people, Diggy the dog gets to stay in his new forever home. An ordinance violation has been dismissed and animal lovers get to chalk this one up to a win.

Diggy gained viral fame, first for a joyful smiley photo of the adopted pooch and his new owner, Dan Tillery. And then for news that the pup was ordered removed from his home because he resembled a pit bull, a breed banned in the Michigan township where he lived.

But first, a little history.

After almost 100 days in a Detroit animal shelter, Sir Wiggleton was finally adopted in June. The new owner, musician Dan Tillery, was so happy with his new pup that he posted a selfie with his new BFF — now named Diggy. The two sport matching joyful grins, an image immediately shared and liked by thousands when posted to the Facebook page of Detroit Dog Rescue, where Diggy was adopted.

But not everyone was so thrilled. Several people saw the image and called the Waterford Township Police and complained about the dog, which they said looked like a pit bull, according to Detroit Dog Rescue. Pit bulls are banned in the Michigan township.

The rescue group said they did their due diligence before the adoption occurred. They provided paperwork from both a veterinarian and the animal control group Diggy came from saying he was an American bulldog and that's how he was licensed in Waterford Township. The rescue group contacted the township to get Diggy's adoption approved.

But apparently the officers who checked out the recent complaint thought he looked like a pit bull, so they gave Tillery three days to remove the dog from his home. Because Diggy was still in his home on June 13 when the deadline arrived, Tillery said he was fined. He posted a message on Facebook to his many supporters worldwide:

Because Diggy still remains at his home with us, I was issued a citation today. Diggy is safe and happy. We are cooperating with the Waterford Police. All we can do now is remain hopeful that this can be resolved soon. Diggy Thanks you all for your support.

An online petition to "lift the dangerous dog ban" in Waterford Township has collected more than 111,000 signatures as of this writing. Many supporters also attended the June 13 regularly scheduled township board of trustees meeting to voice their support for Diggy.

But police said the law is the law.

“From our standpoint, it’s a pretty clear case of an ordinance that makes it clear what’s permissible and what’s not, and our job is to enforce the ordinance,” Waterford Police Chief Scott Underwood told the Oakland Press.

Kristina Millman-Rinaldi, executive director of Detroit Dog Rescue, said the group was hoping to reach a compromise.

“Diggy is living a great life with Dan,” Rinaldi said. “As the nation has seen, he has the best dog smile and is just a loving dog."

Finally, on Sept. 13, charges were dismissed and Diggy gets to settle in forever. The township's ordinance on pit bulls now calls for veterinarians to determine a dog's breed, not police officers, reports the Oakland Press.

“We get to keep our boy,” Tillery wrote in a happy Facebook post . “He’s a good boy.”

If the selfie wasn't sweet enough, here's a video of Tillery, who also happens to be a well-known local musician, singing to Diggy.

This story was originally published in June 2016 and has been updated with new information.

Mary Jo DiLonardo Mary Jo writes about everything from health to parenting — and anything that helps explain why her dog does what he does.