HOUSTON – Republican U.S. Sen. Ted Cruz weathered an intense charge by Democratic Rep. Beto O’Rourke and won a second term Tuesday night in one of the most high-spirited and best-financed campaigns in Texas history.

The victory came around 9:30 p.m. CST as networks projected Cruz the winner of what had been a close race as the unofficial returns began trickling, then streaming in.

“Tonight is a victory for the state of Texas,” Cruz said to loud applause as he bounded onto the state at a hotel ballroom in Houston. “Heidi and I and the girls say thank you.

"This election wasn’t about me and it wasn’t about Beto O’Rourke. It was a contest of ideas. The people of this state decided this race.”

More:Democrats face all but insurmountable odds in Senate after major losses

More:U.S. House: Democrats move closer to gaining control

Cruz, a product of the Tea Party insurgency that steamrolled the Texas political landscape in the wake of Barack Obama’s election to the presidency 10 years ago, rode to victory this round on the same conservative tide that launched his political career and made him a household name almost as soon as he first arrived in Washington.

About 1,000 supporters at his victory party crammed inside a hotel ballroom let out a large and sustained cheer when the Fox News Network called the race for Cruz. Other news outlets followed suit.

Cruz was joined in victory by Gov. Greg Abbott. Down the statewide ballot, other incumbent Republicans faced surprisingly close races. Lt. Gov. Dan Patrick and the others were holding a narrow leads.

"Ted Cruz took the hardest punch that $70 million could throw," said state Sen. Brandon Creighton, a Houston Republican, speaking nearly as soon as the projections were made.

The crowd chanted "We want Ted," but the senator did not immediately take the stage.

His father, Rafael Cruz, said the election returns showed "Texas cannot be bought."

"The message is loud and clear – Texas remains solid red," the elder Cruz, who left Cuba for the United States in 1957.

Cruz congratulated O'Rourke on one of the best showings by a Texas Democrat in recent memory.

"He poured his heart out in this campaign," Cruz said to a small smattering of boos that he quickly tamped down. "Millions of people in this state were inspired by his campaign. ... My responsibility is to represent every Texan."

Cruz’s victory capped a long, grinding campaign that gave Texas its most charged-up midterm election cycle in recent memory. And campaign that continued through Election Day as his forces continued running TV ads while scouring the state for any and all possible votes.

The race, which drew national and international attention because of Cruz’s status as a former presidential candidate and because of the star power gained by the upstart O’Rourke, who raised close to $70 million in a campaign he started 18 month ago as a prohibitive long-shot that hasn’t sent a Democrat to the Senate in 30 years..

More than 40 camera crews and dozens of print journalists were nestled in the middle of the ballroom and surrounded by Republican well-wishers.

With nearly all the late-campaign polls showing Cruz maintaining a stubborn, if narrow lead, the incumbent closed his campaign Monday night after a string of high-energy rallies in his home base of Harris County.

When at each stop most of his supporters signaled they had voted early, Cruz urged them to call friends, neighbors, co-workers and relatives to make sure they’d make it to the polls on Tuesday,

For O’Rourke, Tuesday night’s capped 19 months of campaigning by an unorthodox candidate, who has spent that time crisscrossing the state in a rented minivan with two staffers who documented his every move on Facebook’s live video feature.

He raised record-breaking money in the race after pledging not to accept contributions from political action committees. The effort sparked a light in Texas Democrats, who have not a won a Senate race since Lloyd Bentsen’s last campaign in 1988 and have not who’ve not won any statewide contest in 24 years.

Robert Lowry, a political science professor at the University of Texas at Dallas said it is unclear if the turnout heralds the dawn of renewed participation in a state perennially at the bottom in the voter-participation department.

“My guess it’s a one-off, with few exceptions,” Lowry said. “The next election is a presidential election, and assuming Donald Trump runs again, there’s going to be a whole lot of interest.

“If young voters turnout again, they might develop a habit of voting that sticks with them for the rest of their lives.”

Political strategist Desi Canela who advises Democrats but was not involved in the Senate race said candidates in the future would be wise to emulate the O’Rourke strategy to spur what in past cycles had been low-propensity voters to the polls.

“He understood how to use Facebook and compelling video to engage a base of millennial that, basically, feels ignored,” Canela said.

Regardless of the outcome Tuesday, eyes are on O’Rourke’s political future.

O’Rourke said he has no plans to run for president during a televised town hall with CNN in October, telling the crowd that he would serve out his entire six-year term if elected to the Senate.

“If I don’t win, I’ll be back in El Paso,” he said.

Even with the loss, O’Rourke could run for President in 2020. He could also consider running for the Senate again against Sen. John Cornyn in 2020.

Madlin Mekelburg and John C. Moritz are reporters with the USA Today Network Austin Bureau.