EL PASO, Tex. — Senator Ted Cruz, Republican of Texas, won re-election on Tuesday in one of the tightest midterm races in the country, defeating the best-financed and most popular Democrat to run in Texas in years, Representative Beto O’Rourke.
Mr. Cruz’s victory, reported by The Associated Press, did more than dash Democratic hopes that the party could capture a Senate seat in Texas for the first time since 1988. It promised to restore Mr. Cruz’s standing as a far-right force in American politics, after many leaders in his own party questioned whether he was likable enough to run successfully against a candidate like Mr. O’Rourke, an El Paso congressman known for his charisma.
Mr. Cruz will return to Washington having conquered a Democratic rising star and thwarted a high-profile push to turn one of the reddest states in America at least a faint shade of purple.
Texas voters also elected the state’s Republican governor, Greg Abbott, to a second term.
For months on the campaign trail, Mr. Cruz was more often on the ropes than not, a surprising position for a top Republican incumbent in a state where Democrats hold no statewide offices.
Mr. Cruz’s fund-raising fell far short of his opponent’s — he raised somewhat more than $40 million, compared with more than $70 million raised by Mr. O’Rourke — and he sometimes found himself eclipsed on other fronts as well.
Mr. O’Rourke attracted bigger crowds at some rallies than Mr. Cruz did, including more than 50,000 people who attended a free concert for Mr. O’Rourke in Austin starring the country music legend Willie Nelson. Even Mr. Cruz’s rival event — the rally President Trump attended in Houston that drew up to 19,000 — reinforced the belief among his critics that Republicans were worried.
Party officials acknowledged that the Cruz campaign had underestimated the threat posed by Mr. O’Rourke early in the race and that it was slow to gather steam.
Against that backdrop, Mr. Cruz turned up his rhetoric, casting Mr. O’Rourke as a pro-tax liberal who was anti-police, who favored illegal immigrants over American citizens and who was “running to the left of Bernie Sanders.”
Representative Beto O’Rourke, the Democratic challenger to Senator Ted Cruz, Republican of Texas, greeted supporters in El Paso on Tuesday.CreditTodd Heisler/The New York Times
Mr. Cruz joked that his opponent was heading to Mexico to lead the caravan of Central American migrants making their way to the border. He said Mr. O’Rourke wanted to plunge the country into chaos by impeaching the president, and claimed that his opponent was against guns, the oil-and-gas industry, border security, Israel, low taxes, drug laws, the Department of Homeland Security and standing for the national anthem.
Mr. O’Rourke largely refused, with a few exceptions, to go on the attack against Mr. Cruz in response, a policy that Republican and Democratic strategists considered a key mistake. And they said Mr. O’Rourke failed to spend enough time and money drawing a contrast between himself and his opponent; he never made a persuasive closing argument to voters about why they should fire Mr. Cruz.
“I think Beto has done far too much messaging that has excited his national donor base, rather than his Texas voter base,” said Ted Delisi, a Republican political consultant in Austin who was chief campaign strategist for Senator John Cornyn in 2002.
“You have to pull somebody away on issues,” Mr. Delisi said, speaking as if he were addressing Mr. O’Rourke. “You have gotten as far as you can get on personality and, sure, you are more likable than Ted Cruz. Willie Nelson loves you. The concert was fun. But now what?”
Throughout the campaign, Mr. Cruz repeatedly had to explain his relationship with Mr. Trump. After Mr. Cruz’s bid for the Republican presidential nomination failed in 2016, the senator declined at first to support Mr. Trump, but later eagerly embraced him, even though Mr. Trump had mocked and demeaned Mr. Cruz’s wife and father.
His back-and-forth with the president made Mr. Cruz unappealing to many Texans, and allowed Mr. O’Rourke to attract some votes from Republicans — but ultimately, not enough to change the course of the election.
Mr. Cruz brushed off any concerns about how he was faring in the final days of the campaign. “If you want to see low taxes and low regulations continue, if you’re happy with the economic boom in Texas, if you like seeing lots and lots of jobs, come out and vote, and let’s keep on the path we’re on,” Mr. Cruz said after one rally.
At times Mr. O’Rourke’s widely watched candidacy seemed to pull a page from Mr. Cruz’s own playbook.
In 2012, Mr. Cruz became a conservative rock star when he bucked the Texas political establishment and defeated a powerful lieutenant governor in a Republican primary runoff for the Senate seat. Mr. Cruz was a Tea Party-backed insurgent whose grass-roots campaign captured national attention.
In 2018, though, it was Mr. O’Rourke who played the part of grass-roots insurgent and Mr. Cruz who represented the establishment. It was a role Mr. Cruz seemed to relish, as he went from rally to rally warning voters that Texas’ longstanding culture and identity were under assault by the left.
“Don’t California our Texas — you’re exactly right,” Mr. Cruz told supporters in the East Texas city of Tyler, echoing a phrase a woman in the audience had used. “Whenever liberty is threatened,” he added, “Texans rise to the occasion.”