Updated

A pug whose mugshot went viral is back with her family after New Jersey police tracked down her owners and collected the required -- and delicious -- bail.

Bean the pug escaped from her owner’s Cape May home Sunday. The dog’s “pug mug” soon went viral after Cape May police posted it on Facebook.

“This is what happens when you run away from home,” police wrote, noting the pooch was caught while "sneaking through yards,” just one street away from the town's famous beaches.

Patrolman Michael LeSage said he found Bean in a yard and when he called the dog to get into his cruiser, the dog couldn’t hop into the vehicle on her own, he told NJ.com. So LeSage lifted her up.

It took a couple of hours for Bean’s owners to figure out where she scampered to.

Hadley Hubbard, a Baltimore, Maryland, resident, thanked police and posted on social media that Bean was asleep after an exciting time behind bars.

Bean paid her bail in cookies, LeSage said. It wasn't immediately clear what type of cookie, however.

Fox News’ Nicole Darrah and the Associated Press contributed to this report.