Story highlights Armando Martinez: "It felt like a sledgehammer hit me over the head"

The Hidalgo County Sheriff's Office is investigating the shooting

(CNN) A Texas lawmaker is lucky to be alive after an apparently stray bullet hit his head during a New Year's celebration early Sunday, authorities said.

State Rep. Armando "Mando" Martinez, D-Weslaco, said his wife had just given him a kiss shortly after ringing in the new year with family and friends, and the next thing he knew, "it felt like a sledgehammer hit me over the head."

A bullet fragment had just punctured the top of the south Texas legislator's head.

Martinez said he had just stepped outside a home in a rural neighborhood north of Weslaco when he was hit.

Martinez, 40, was transferred to the neurosurgical unit at Valley Baptist Medical Center in Harlingen, where surgeons removed the bullet fragment. The fragment had penetrated his skull and lodged itself into the dura mater, the top layer of the brain, doctors told Martinez.

Read More