The speaker of the Texas House, Dade Phelan, won renomination in a runoff on Tuesday, surviving a bruising Republican primary challenge from a party activist and first-time candidate who was backed by former President Donald J. Trump and his Texas supporters.
The race, in a southeast Texas district that includes part of the city of Beaumont, was a bitter political showdown among some of the most powerful players in Texas politics, and was likely to have been one of the most expensive ever for a Texas House seat.
Millions poured in to the campaigns during the primary, including large donations from West Texas oil and gas billionaires and out-of-state school-choice advocates who backed the challenger, David Covey. For his part, Mr. Phelan had help from deep-pocketed donors like Miriam Adelson, the Las Vegas casino magnate and widow of the Republican megadonor Sheldon Adelson.
Mr. Covey, a technical adviser to the oil and gas industry who has described himself as a “very committed Christian and a conservative,” led Mr. Phelan in the first round of voting in March, when neither candidate won a majority.
But during the runoff, Mr. Phelan rallied his supporters and campaign contributors, significantly out-raising his opponent through the middle of May.
“We came this close,” Mr. Covey said in a speech to supporters in Orange, Texas. He added that even in defeat his campaign had started a movement.
Mr. Phelan, in declaring victory on Tuesday night in Beaumont, told a crowded room of campaign volunteers, supporters and several members of the Texas House that the campaign against him had been based on “lies” and “deceit.”
“We’re done with that.” Mr. Phelan said. “House District 21 is not for sale.”
The close call for Mr. Phelan, who had not faced a challenger from either party in a decade, was likely to reverberate in Republican politics. His campaign raised more than $12.6 million to defend him.
Many activist Republicans in Texas see Mr. Phelan as insufficiently conservative. Chief among their complaints: He supported the longstanding Texas House practice of giving some committee chairmanships to the opposing party.
Ousting Mr. Phelan became the biggest prize sought by a hard-right faction of the Republican Party that includes the state attorney general, Ken Paxton, and Lt. Gov. Dan Patrick. That faction, which is aligned with Mr. Trump, has been trying to remake the Texas House, a moderating force in state politics, in the mold of the more rigidly conservative Texas Senate.
Defending Mr. Phelan became the goal of many members of the party’s old guard, including a former governor, Rick Perry, who campaigned on behalf of Mr. Phelan and appeared with him several times during the primary race.
The aggressive focus on Mr. Phelan came after the Texas House voted to impeach Mr. Paxton on charges of corruption and abuse of office last year. (Mr. Paxton was acquitted in a Senate trial that Mr. Patrick presided over.)
And it followed a session in which a small number of rural Republicans in the Texas House once again blocked proposals for state-funded vouchers that families could use to send children to private schools.
Gov. Greg Abbott, who has campaigned against Texas House members who opposed the voucher proposals, stayed on the sidelines in Mr. Phelan’s primary race.
Though Mr. Phelan is now poised to win re-election in November without a Democratic challenger for his strongly Republican seat, he is not guaranteed to have another legislative session as speaker. Some Republican representatives have already been suggested as possible replacements, setting the stage for a renewed fight for control of the Texas House.