Think of it as a time when bipartisanship went awry. The result surprised even the people who voted for it.

“I think many folks, like myself, didn't think there was a majority” to undo the lottery, said state Rep. Mike Villarreal, D-San Antonio, who voted against the bill to continue the commission, then reversed course later that afternoon when the bill was brought back.

Said one staffer of a representative who initially voted against the bill: “Everyone was shocked when it failed. The leadership didn't know it was going to happen, the appropriations people didn't think it was going to happen, nobody thought this was going to happen. Nobody saw this coming.”

The bill managed to pass a key threshold on the House floor by a vote of 92-53, after failing the first time by a vote of 65-81. It will be considered for final passage Wednesday.

Several representatives said they expect additional amendments to the bill will be offered Wednesday, including one that would call for a study of potentially phasing out the lottery. However, because of where the bill is in the legislative process, any amendment would require a two-thirds vote.

Even if the House had failed to pass the bill to continue the lottery commission, it doesn't mean that the commission would have died. Lawmakers would have still had the option to include it in a sunset “safety net bill” that keeps agencies from dying if the Legislature doesn't get around to passing legislation for their continuation.

“This was simply a bill about the continuation of the lottery commission, which regulates both the lottery and charitable bingo,” said Rafael Anchia, D-Dallas, a member of the Sunset Commission, which examined the agency, and the author of the bill. “It became a proxy debate for whether we should have a lottery or not.”

The opposition came from a multitude of sources — some lawmakers who initially voted “no” did so as a protest vote against how the lottery commission is run; others voted no because they view the lottery as an unfair tax on the poor; some conservatives opposed it because they believe the lottery is immoral; and there was at least one tea party Republican who voted no because he doesn't believe the state should have a “monopoly” on gambling.

“We had the full gamut of motivations there,” said Rep. Lyle Larson, R-San Antonio, who initially cast a protest vote against the lottery commission and then volunteered to help the Republican leadership whip his fellow representatives back into line.

He said he lobbied eight to 10 lawmakers who also cast an initial vote against the lottery commission's renewal, making a practical argument — it's far too late in the session make such a drastic change, which would toss more than $2 billion of revenue out the window and would complicate budget negotiations with the Texas Senate.

“Several of them switched their votes, not just because I spoke to them, they also had the same issues as far as the $2 billion this late in the process — how do you backfill that in the education budget,” Larson said.

In the second vote, all of the San Antonio delegation representatives present voted to continue the commission. Rep. Trey Martinez Fischer, a Democrat, was absent.

Most of the roughly hour-long debate was routine, even milquetoast, by the rowdy standards of the Texas House. Just during the last session, a trans-vaginal sonogram probe was used as a prop on the floor, a state representative threw a rule book into the air, and vicious debates about the budget and cultural issues stretched into the night.

Then Rep. Scott Sanford, R-McKinney, rose to speak against the bill, offering an indictment of the lottery, that it is an immoral tax that targets the poor and the poorly educated.

Applause could be heard in the chamber at the end and two representatives usually opposed on the issues — Lon Burnam, D-Fort Worth, and Jason Issac, R-Dripping Springs — lined up to endorse Sanford's speech. They were followed by another two state representatives who spoke against the bill.

The vote was then called and the board where votes are recorded began to light up, with a lot more no votes than a lot of people anticipated.