Sen. Ted Cruz (R), left, faces a challenge from Rep. Beto O'Rourke (D) in the U.S. Senate race in Texas. (Susan Walsh/AP; Ivan Pierre Aguirre/The Washington Post)

Even before the primary votes were counted Tuesday in Texas, Sen. Ted Cruz (R) went on the attack against his November opponent.

Cruz and Democratic U.S. Rep. Beto O’Rourke (Tex.) were both quickly declared winners by the Associated Press on Tuesday after polls in the state closed. And, quickly, both candidates turned toward facing each other in November.

Cruz called out O’Rourke by name in a conference call with reporters before polls closed and then repeated his criticisms of O’Rourke’s support of gun-control measures, the Affordable Care Act, and “amnesty and open borders” in a TV interview after results were in.

“The good news is that there are a lot more conservatives in Texas than liberals,” Cruz said. “If conservatives show up in November, we’ll be just fine.”

It was a fresh sign that the 2018 election in Texas, which has not elected a statewide Democrat since 1994, could be more competitive than the state is accustomed to.

Cruz has largely settled into the background in Washington after his unsuccessful bid for the presidency in 2016. (Chip Somodevilla/Getty Images)

O’Rourke, 45, a three-term congressman, still faces an uphill battle. But there are signs he could at least keep November’s election close, including an impressive turnout among Democrats for Tuesday’s primaries, robust fundraising reports and polls showing declines in popularity for Cruz and President Trump.

O’Rourke declined to respond to the attacks from Cruz in a Facebook Live broadcast to his supporters. “What is really exciting about what is going on in Texas right now is that all of the energy is around the big things we want to do together,” he said.

Elected in 2012, Cruz, now 47, earned national attention early on when he launched an overnight filibuster-style takeover of the Senate floor ahead of a government shutdown. He parlayed the acclaim from conservatives into a 2016 presidential bid and unsuccessfully challenged support for then-candidate Donald Trump among delegates to the Republican National Convention.

In the past year, Cruz has mostly settled into the background, working with Trump on policy issues and making nice with Senate Majority Leader Mitch McConnell (R-Ky.) and other party leaders.

Rep. Beto O'Rourke (D-Tex.) won the Democratic primary on March 6 and is set to battle Sen. Ted Cruz (R) in the U.S. Senate race in Texas. In his victory speech posted on Facebook, he urged Texan democrats to head to the polls and get ready to "knock on doors." (Beto O'Rourke/Facebook)

The Cruz-O’Rourke race is set to be a clash of ideology and style. Cruz was the only senator to vote against even launching a formal debate over immigration policy last month, declaring that Trump’s call to grant legal status to roughly 1.3 million young immigrants amounted to amnesty. O’Rourke is a strong supporter of a comprehensive immigration overhaul. Cruz has been a strong proponent of gun rights, while O’Rourke has signed on to a new bill that would restore and build on the expired ban on military-style weapons. 

O’Rourke was born and raised in El Paso and won his congressional seat in 2012. He represents a congressional district just across the border from Mexico that is overwhelmingly Latino. Although his childhood nickname, which he’s used his entire political career, is a diminutive of “Roberto,” he was born Robert Francis O’Rourke.

O'Rourke poses for a photo after a town hall event in Falfurrias, Tex., in January. (Eric Gay/AP)

Shortly after Trump’s election, O’Rourke began touring Texas, travels that he says convinced him that “the conventional wisdom” about Texas politics was off the mark. 

“I’d go to Lubbock or Midland or College Station, and I’d see folks coming to events saying, ‘I voted for Trump, but I think we need something better in our government,’ ” O’Rourke said in an interview with The Washington Post last year.

Gallup’s 2017 year-long average found Trump’s job approval rating at 39 percent among Texas adults, with 54 percent disapproving. A Texas Tribune-University of Texas poll of registered state voters last month found that the same shares, 46 percent, approve and disapprove of Trump. Cruz also got split reviews, with 40 percent approving and 41 percent disapproving. Strong disapproval of Cruz was 10 points higher than strong approval (32 percent vs. 22 percent), according to the survey, which was conducted online by YouGov. 

Texas primary election results 2018: Senate, Governor and House races

In recent years, Texas’s adult population has been much less Republican than those who actually register to vote and go to the polls. But trends have shifted so much in the state that Gallup has moved it to “competitive” from a rating of leaning Republican.

Another sign of Cruz’s growing vulnerability is money. Over the first few weeks of 2018, O’Rourke raised $2.3 million, compared with $803,000 for Cruz, according to federal fundraising reports. The latest hauls signaled a narrowing cash-on-hand gap between the two: O’Rourke reported $4.9 million saved up, while Cruz had $6 million.

But even with all those signs of a potential shift in Texas, political handicappers still showed Cruz as the front-runner going into Tuesday’s primaries. The nonpartisan Cook Political Report and Inside Elections classify the race between Cruz and O’Rourke as “Likely Republican” and “Solid Republican,” respectively.

Scott Clement, Seung Min Kim and Michael Scherer contributed to this report.