Cops say they got their goat after an attempted home invasion in Northern California earlier this week.

Police in Sebastopol in Sonoma County nabbed the animal trying to bang its way into an occupied home at 1:38 a.m. Monday.

The startled homeowner, a woman, called 911 to report persistent knocking at her front door.

“When officers arrived on scene the subject was still knocking on the front door, with their head,” Sebastopol Police Chief Jeff Weaver said in a Facebook post Tuesday. “The subject, a goat, was safely taken into custody and reunited with their owner later that morning.”

The goat’s owner appeared to have been one of the woman’s rural neighbors, the Santa Rosa Press Democrat reported.

The chief’s Facebook post included a photo of officer Andy Bauer and the goat.

Within hours, the post received nearly 1,000 likes and more than 35,000 views, according to the paper.

“That’s considered ‘viral’ by our standards,” Weaver told the paper.