President Trump says he’ll ride to the rescue of onetime bitter rival Sen. Ted Cruz this fall, the strongest indication yet that the Texas conservative firebrand is getting nervous about his challenger, a rising liberal star with a growing national profile.

Trump tweeted Friday that he would headline “a major rally” for Cruz in October and was “picking the biggest stadium in Texas we can find.” He added, “Ted has my complete and total Endorsement,” and called Democratic Rep. Beto O’Rourke “a disaster for Texas — weak on Second Amendment, Crime, Borders, Military, and Vets!”

The Twitter declaration of support was a long way from Trump’s assessment of Cruz’s record during the 2016 campaign. He declared the senator “has accomplished absolutely nothing” for Texans. Cruz labeled Trump “a sniveling coward.”

But the promise of presidential assistance suggested Cruz — and his party — are feeling the heat in his bid for reelection.

Trump has long planned to travel to bolster Republican candidates before November’s midterm election, but he was not expected to spend valuable time in reliably red Texas for a race that for months looked like a Cruz cakewalk.

“Either Ted Cruz is in trouble or it’s a remarkable waste of the president’s resources,” said Republican strategist Rick Tyler, who worked for Cruz’s presidential campaign.

The Texas Senate seat, Tyler noted, was supposed to be the GOP’s “safest seat this cycle.”

Trump’s announcement was also likely to intensify the hype around O’Rourke, who is giving up his House seat representing El Paso to run. O’Rourke has consistently out-raised Cruz and has rocketed to national stardom in recent weeks. Video of him defending NFL players’ right to protest the national anthem has been viewed by millions and was praised by NBA star LeBron James.

National magazines have speculated that O’Rourke could be a vice presidential pick in 2020, or even run at the top of the ticket — even if he doesn’t pull off the upset in Texas, which hasn’t elected a Democrat to statewide office since 1994.

Yet Cruz’s race appears to be far tighter than the state’s history would suggest.

Those close to Cruz’s campaign say that internal polling shows O’Rourke trailing by just 5 or 6 percentage points, which is in line with recent public polls.

Republicans across Texas and in Washington, D.C., are especially concerned about the Democrat’s prolific fundraising. While Cruz has raised more money than any other Republican Senate candidate this cycle, O’Rourke, who reported having raised nearly $24 million through June, could ultimately double Cruz’s fundraising, despite shunning support of outside political groups.

Cruz has repeatedly attacked his opponent, doing everything from referring to him by his given first name, Robert, to criticizing O’Rourke for voting against a bill offering tax breaks for Hurricane Harvey victims. But little has slowed O’Rourke’s rise.

A super PAC aligned with Senate Majority Leader Mitch McConnell (R-Ky.) said Friday it was prepared to help if necessary. That’s despite Cruz’s charge, two years ago, that McConnell was a liar.

“We’ll be there for Ted Cruz if he needs us. We’re team players,” said Chris Pack of the McConnell-backed Senate Leadership Fund.

Trump’s announcement that he would get involved followed a series of private discussions between the White House and the Cruz campaign about how the GOP president, who handily won Texas in 2016, could be most helpful, according to Republicans with direct knowledge of the discussions, who asked for anonymity because they were not authorized to discuss the matter.

But even in the red state, a Trump visit carries some political risks, particularly in areas with higher concentrations of suburban and minority voters.

Republicans expect Trump to be able to fill a sports stadium, as he suggested on Twitter, although there is some concern that an appearance at a place like the Dallas Cowboys’ stadium in Arlington, between Dallas and Fort Worth, could do more harm than good by energizing O’Rourke’s supporters.

Other locations would be more welcoming, including Texas A&M’s stadium in College Station, which holds more than 100,000, or Texas Tech’s in Lubbock, which holds roughly 60,000.

A Cruz spokeswoman did not return messages about discussions on scheduling or location for a joint rally with Trump.

Cruz said in recent weeks that he wouldn’t be surprised if Trump came to Texas to campaign. But unlike many other Republicans, he hasn’t directly appealed for a presidential visit. Asked after a recent rally whether he would need Trump’s help, Cruz dodged.

“What we need to win in November is for Texans to show up and vote,” he said. “This election is about turnout.”

A Trump visit could be the latest in an awkward dance with Cruz that has made the pair a political odd couple.

Cruz spent the early months of the 2016 presidential race praising Trump, betting that the reality TV star’s supporters would flock to him if their candidate’s meteoric rise flamed out. The two later clashed bitterly as Cruz finished second for the GOP nomination, with Trump making fun of Cruz’s wife’s appearance and suggesting that his Cuban-born father had a hand in President Kennedy’s assassination.

Trump also savaged Cruz on Twitter: “Why would the people of Texas support Ted Cruz when he has accomplished absolutely nothing for them?”

Cruz responded by calling Trump “a sniveling coward,” “a pathological liar” and “a serial philanderer.” He refused to endorse him at the Republican National Convention, withholding his support until barely a month before election day.

The relationship has improved since, although resentment lingers among many die-hard Trump supporters.

It’s not yet clear whether Trump’s kind words on Twitter, and the would-be rally, can heal those wounds.

CAPTION

Center fielder Mike Trout signs a record-breaking contract to stay with the Los Angeles Angels for 12 more years.

Center fielder Mike Trout signs a record-breaking contract to stay with the Los Angeles Angels for 12 more years.

CAPTION

Center fielder Mike Trout signs a record-breaking contract to stay with the Los Angeles Angels for 12 more years.

Center fielder Mike Trout signs a record-breaking contract to stay with the Los Angeles Angels for 12 more years.

CAPTION

Los Angeles Times sportswriters Jorge Castillo and Dylan Hernandez break down the first part of the Dodgers' 2019 season and what they need to do to get back on track.

Los Angeles Times sportswriters Jorge Castillo and Dylan Hernandez break down the first part of the Dodgers' 2019 season and what they need to do to get back on track.

CAPTION

Los Angeles Times food columnist Lucas Kwan Peterson eats the American League and Middle Ages columnist Chris Erskine noshes on the National to decide which team has the best grub.

Los Angeles Times food columnist Lucas Kwan Peterson eats the American League and Middle Ages columnist Chris Erskine noshes on the National to decide which team has the best grub.

CAPTION

Jaime Jarrin, the Spanish-language radio play-by-play broadcaster for the Dodgers, shares memories of his wife, Blanca, who died Feb. 28.

Jaime Jarrin, the Spanish-language radio play-by-play broadcaster for the Dodgers, shares memories of his wife, Blanca, who died Feb. 28.

CAPTION

With his 1991 drama "Boyz N the Hood," director John Singleton became the first African American filmmaker nominated for a directing Oscar. He died following complications from a massive stroke he suffered on April 17.

With his 1991 drama "Boyz N the Hood," director John Singleton became the first African American filmmaker nominated for a directing Oscar. He died following complications from a massive stroke he suffered on April 17.