Gallegos' political consultant, Harold Cook, released a statement saying the state senator passed away in a Houston hospital surrounded by his family.
"The Senator's family is enormously grateful for the outpouring of support, thoughts, and prayers expressed during the last few days, and respectfully requests media to continue respecting their privacy as they work through this difficult time," Cook said.
Gallegos was running against Republican R.W. Bray in the November general election. It's too late to remove his name from the ballot. If Gallegos wins, the governor will need to schedule a special election to replace him.
The staunch Democrat had represented Senate District 6 in Harris County since 1995, having served in the Texas House the previous four years. He developed a reputation for toughness in 2007 when he showed up in the Senate chamber shortly after a liver transplant to vote against a measure that would have required a photo ID in order to vote in Texas.
"They broke the mold with Mario. He was a character who lived life to the fullest, whether he was having fun or working for his constituents, he did everything to the max," said close friend and colleague state Sen. Leticia Van de Putte. "He took on the big battles, no matter the risk, and he didn't care whose feathers he was rustling. He fought to the end and even tried to cheat death."
Gallegos remained at the Capitol, despite his body trying to reject the new organ, and he often rested in a private room just off the Senate floor in case his vote was needed. Republicans failed to pass the photo ID bill in 2007, but eventually made it into law in 2011.
"He stopped that legislation that year, and its subsequent passage doesn't lessen his heroism, it reinforces it," said state Sen. Kirk Watson, on behalf of the Democratic Caucus. "Texas will be a lesser place without Mario's heart and heroism."
Gallegos did not keep secret that he needed the new liver because he was a recovering alcoholic and he also suffered from diabetes. He sought treatment for alcoholism in 2006 and announced less than a year later that he needed the transplant, which he received in January 2007.
Last year Gallegos chaired a sub-committee on flooding and evacuation and also served on the education, jurisprudence, international relations and intergovernmental relations committees. He played a key role in stopping a bill to allow people to carry concealed handguns on college campuses when he switched his vote to oppose the measure.
The Hispanic lawmaker graduated from the University of Houston and spent 22 years as a Houston firefighter before retiring as a senior captain. That's when he decided to run in 1990 for a seat in the Texas House.
"I've seen with my own eyes the love and friendship lavished upon him by his family, friends and fellow firefighters," said Republican Lt. Gov. David Dewhurst, who presides over the Texas Senate. "He was a friend and colleague to all the Senators and myself, and he will be dearly missed by all of us."
Gallegos was noted for his strong defense of civil rights and support for economic development in his district, where most of his constituents are black or Hispanic and about a quarter of them live in poverty. About one in five speak little or no English.
Rarely did Gallegos face significant opposition for re-election, but in the midst of a tough Democratic primary in 2004, a Houston woman sued Gallegos for emotional distress following a 17-year extramarital affair. He barely won the primary, but went on to win the general election with 90 percent of the vote.