A man in Texas injured while taking a selfie ended up with a mug shot.

>> Read more trending news

Galveston police told KHOU that Billy Pettice, 38, was rescued Friday from the Gulf Intracoastal Waterway after falling 40 feet while trying to take a selfie.

Pettice was hospitalized and treated for broken ribs. While in the hospital, authorities ran a warrant check and discovered that Pettice was wanted on a misdemeanor burglary charge in Louisiana, KHOU reported.

After his release from the hospital, Pettice was arrested on the outstanding warrant, police said.