Because he died of complications from liver disease within 74 days of the election, Gallegos remained on ballot paper to posthumously defeat his Republican challenger.

His family and friends kept campaigning until the polls on his behalf after he passed away last month.

Gallegos’ widow Theresa said the win was important in honouring his legacy.

“It’s been very bittersweet the last couple of weeks, the loss of my husband and all the people coming out to support him,” she said.

Gallegos had pre-selected candidate Carol Alvardo to run in a special election, which Texas Governer Rick Perry now has 20 days to call.

It’s not the first time a dead incumbent has been voted in – Republican Glenda Dawson kept her seat in 2006 despite dying two months earlier.

Image via Getty