Armando Martinez (center) poses with constituents. (Photo: mandomartinez.com)

A Texas lawmaker who was struck in the head by a stray bullet on New Year’s Eve plans to introduce a bill aimed at preventing celebratory gunfire.

“If my legislation could help save a life, you know, then definitely that’s what we’re gonna be looking at doing,” Rep. Armando Martinez, a Democrat from Weslaco, Texas, told the Texas Tribune on Monday in a phone interview from the Valley Baptist Medical Center, where he was recovering. The longtime representative, who was re-elected for a seventh term in November, was released later Monday.

Martinez was watching New Year’s Eve fireworks with family and friends in a residential neighborhood when he was struck.

“At the stroke of midnight, my wife comes over and gives me a hug and a kiss,” Martinez told the Monitor, a newspaper based in McAllen, Texas. “And right after that, I felt like a sledgehammer hitting the back of my head.”

According to KGBT-TV, the bullet punctured his skull, and Martinez underwent a 45-minute surgical procedure to remove it. The Hidalgo County Sheriff’s Office is investigating the shooting.

“We have reason to believe that he was hit by a bullet that was fired into the air,” Hidalgo County Sheriff Sgt. J.P. Rodriguez said in a statement.

Earlier on New Year’s Eve, Martinez said the family had actually sought shelter in a garage because they heard gunfire — a common sound during celebrations, particularly in the South.

“I think that’s something that definitely needs to change.” Martinez told the Tribune, adding that he plans to consult with local officials before proposing legislation.

“Growing up, we grew up around guns,” he said. “I’m a hunter. But everybody knows better than to get a gun and fire it up in the air, because what goes up must come down.”