Sen. Ted Cruz, the first senator of Latin American heritage in Texas, implying that his opponent may be adopting a Spanish nickname to win votes shows just how competitive the fight for the Latino vote will be during the 2018 midterms.

In a 60-second radio ad, the Republican's campaign attacked Rep. Robert O'Rourke (D-Tex.) for going by “Beto,” a nickname he was given as a child and has used throughout his political career, according to The Washington Post's Ed O'Keefe.

“Liberal Robert wanted to fit in, so he changed his name to Beto and hid it with a grin,” a song in the ad says.

But critics were quick to pounce on Cruz over the fact that “Ted” is not his given name. Cruz, whose legal name is Rafael Edward Cruz, started using the nickname when he was 13 after going by “Felito” for most of his life. His father, a Cuban immigrant, was “furious” with his decision, Cruz once recalled.

Cruz's move to go after “Beto” was a strategic one during a time when his opponent — who, like Cruz, won his primary in Tuesday's election — is raising large sums of money in an effort to unseat the senator in November.

Sen. Ted Cruz (R-Tex.) released a radio ad titled, “If you're gonna run in Texas.” (Ted Cruz)

Texas hasn't elected a statewide Democrat since 1994, and Cruz understandably doesn't want that streak broken against him. And despite some success, O'Rourke still faces an uphill challenge. But times are different now than in 2012, when Cruz and O'Rourke came to Washington. The state's Democratic base, which includes large numbers of Latino voters, is motivated to vote against President Trump's agenda and the lawmakers who have endorsed it.

But even if Cruz's suggestion was true, O'Rourke probably wouldn't need to feign Latino heritage to win the Latino vote. Although Cruz entered the 2012 Senate race as Texas's first Hispanic solicitor general, he still lost the Latino vote.

According to Latino Decisions exit polls, Cruz won 35 percent of the Mexican American vote and 34 percent of support from other Latinos in his 2012 race against Paul Sadler, like O'Rourke a white, Democratic male from a predominantly Latino Texas city.

But what Cruz's team probably realizes is that in 2018, the margins matter. Although Cruz backs policy ideas that many Latino voters don't, including support for a wall along the U.S.-Mexico border and pushing back against a path to citizenship for “dreamers,” he's hoping that some Latino voters question O'Rourke's sincerity. And this could work in Cruz's favor, because several recent races since Trump's election have been decided by single-digit percentage points — even in states such as Alabama that have a long history of electing conservative lawmakers.

Cruz may not be expecting to win the Latino vote, but it probably does matter to him just how much he loses it by. Because if Cruz attracts even less Latino support than he did in 2012, it could signal that the “blue wave” that many have been predicting will take over Texas could happen in 2020.

But it's not just keeping Latino voters from backing O'Rourke that matters to Cruz. He wants to make sure that people in the demographics that supported Trump in 2016, and still generally approve of his performance, show up for him. Trump may be losing support with many of the identity groups — Republicans, white women, white evangelicals — that sent him to the White House, but the “cultural anxiety” that led many within those groups to back Trump in the first place still exists. And some believe that Cruz's ad attacking an opponent whose immigration policies align with left-leaning activists was aimed at turning out the white working-class voters whom the GOP is working hard to keep.

“It doesn't matter that Ted Cruz' ad is both empty and hypocritical,” tweeted Sarah Reese Jones, publisher of PoliticusUSA. He is playing the base's Lone Star Shooter to homey country music with a flag + the cross. He doesn't need to be real or have a position. It's identity politics.”

Jones is right. As O'Keefe noted:

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.

The race is a reminder of how central identity politics is to the American political climate. Right now, partisanship appears to rule most. Cruz appears to know this and seems uninterested in winning some of the Democratic voters who helped Trump beat Hillary Clinton.

“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.”