Never mind the doghouse — this pooch wound up in lockup!

A New Jersey pug named Bean had a ruff weekend when she was collared by cops for sneaking through a stranger’s yard.

“This is what happens when you run away from home,” Cape May Police wrote on Facebook Sunday — along with the dog’s rueful mug shot.

Another photo showed the bad dog defiantly sticking her tongue out from a jail cell.

Patrolman Michael LeSage got a call from a family reporting the pup-perp was strolling through their yard — and said he tried to get Bean to hop in the back of his police car, “but her short little legs couldn’t make it… so I had to lift her up,” he told NJ.com.

Bean’s owner heard about the pug’s mug shot after it was shared over 8,000 times — and brought cops cookies to cover her bail.

“Thank you CMPD from Bean the pug’s family for taking such good care of her,” Baltimore-resident Hadley Hubbard wrote on Facebook. “She is sound asleep at home after an exciting afternoon on the run.”