A Texas man gunned down a puppy that had wandered into his yard — and then he hit the ground to avoid gunshots fired by the dog owner’s friend.

Joe Ramirez was not wounded in the return fire, but both he and the friend were arrested on felony charges, reported KENS-TV.

The 37-year-old Ramirez told police he grabbed a shotgun Wednesday in frustration after a neighbor’s puppy repeatedly came into the yard of his San Antonio home, ate cat food and defecated.

ADVERTISEMENT

He told investigators he thought the gun contained blanks, and Ramirez insisted he meant only to scare the puppy after trying to shoo it away.

The dog owner, however, said she heard a gunshot, followed by the sound of a dog yelping, so she went outside to investigate.

The neighbor told police that she saw Ramirez standing over her dog and shoot the animal at close range.

That’s when the woman’s friend opened fire on Ramirez and his roommate, police said.

Neither of them were wounded in the shooting.

ADVERTISEMENT

Police arrested 30-year-old Angela Cruz on two counts of aggravated assault with a deadly weapon.

Ramirez, who has two previous drug convictions and multiple arrests for drug possession, was charged with cruelty to a non-livestock animal.

ADVERTISEMENT

The dog owner and Ramirez’s roommate were questioned in the shootings, but they were not charged.

Watch this video report posted online by KENS-TV: