A Texas man decided to get rid of an armadillo by shooting it with a gun but ended up injuring himself.

Officials from the Cass County sheriff's department said the man, who was not identified, went out of his house at around 3 a.m. on Thursday and spotted an armadillo roaming on his Marietta property, Reuters reported.

The man reached for his .38 revolver and shot at the armadillo three times.

"His wife was in the house. He went outside and took his .38 revolver and shot three times at the armadillo," Cass County Sheriff Larry Rowe said, according to KLTV.

However, one of the bullets proved no match for the armadillo's hard shell when it ricocheted and hit the man in the head.

The man sustained a minor wound, and he was taken to a nearby hospital for treatment, USA Today reported.

The sheriff's department said the incident was an "accidental shooting." The fate of the armadillo is not yet known, as thee investigation is ongoing at this time, KLTV reports.

This is not the first time that an armadillo's hard shell deflected a bullet. In April, a man from Georgia shot an armadillo and killed it, but the bullet ricocheted off the animal's hard shell and ended up hitting his 74-year-old mother-in-law in the back, according to WALB. Fortunately, the mother-in-law's injuries were non-threatening.