A pet squirrel who defended its owner’s home by repeatedly scratching a home intruder has been credited with foiling a burglary.

Idaho resident Adam Pearl said he returned home earlier this week to find the doors open, marks around his gun safe and a number of items missing, Fox News reports .

When police officer Ashley Turner arrived on the scene to file a report, she expressed surprise at the appearance of Mr Pearl’s pet squirrel “Joey”, scuttling between her legs.

"She says, 'Whoa, what was that?', and I said, 'Ahhh don't worry about that, that's just Joey, my pet squirrel, you know',” Mr Pearl recounted.

Mr Pearl reassured the officer Joey didn’t bite, but admitted it was a possibility, “’cause he is a squirrel”.

During Officer Turner’s subsequent investigation, she managed to track down a suspect with a number of suspicious scratches on his hands.

“So she asked him, 'Did you get that from the squirrel?'” Mr Pearl said.

“And he says, 'Yeah, damn thing kept attacking me and wouldn't stop until I left'."

As a result of her investigation, Ms Turner was able to recover a number of Mr Pearl’s possessions.

Mr Pearl said he has since rewarded Joey’s unexpectedly fierce show of loyalty with his favourite snack: candy.

"He is a pain in the butt, but he is great,” Mr Pearl said.