By WILL WEISSERT and STEVE PEOPLES, Associated Press

AUSTIN, Texas (AP) — President Donald Trump says he’ll ride to the rescue of one-time bitter rival Sen. Ted Cruz this fall, the strongest indication yet that the Texas conservative firebrand is getting nervous about his challenger, a liberal darling with a growing national profile.

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

The tweet of support was a long way from Trump’s previous assessment of Cruz’s record. He once declared the senator “has accomplished absolutely nothing” for Texans and repeatedly derided him as “Lyin’ Ted.” Cruz has labeled Trump “a sniveling coward.”

The promise of presidential assistance suggested Cruz — and his party — are feeling the heat. Trump has long planned to travel to bolster Republican candidates before November’s midterm elections, 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 further intensify the hype around O’Rourke, who has consistently outraised Cruz and has rocketed to national stardom in recent weeks. Video of O’Rourke, who is giving up his El Paso House seat to run, 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 perhaps run for the White House — even if he doesn’t pull off the upset in Texas, which hasn’t elected a Democrat to statewide office since 1994, the nation’s longest political losing streak.

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

Those close to Cruz’s campaign report 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 Washington have become most concerned with the Democrat’s prolific fundraising. Cruz has raised more money than any other Republican Senate candidate this cycle so far. And 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 full name, Robert, to criticizing O’Rourke for voting against a bill offering tax breaks for Harvey victims. So far, little has slowed O’Rourke’s rise.

A super PAC aligned with Senate Majority Leader Mitch McConnell 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 followed a series of private discussions between the White House and the Cruz campaign about how the Republican president, who handily won Texas in 2016, could be most helpful, according to Republicans with direct knowledge of the discussions but 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 Dallas Cowboys stadium in Arlington, which is set between Dallas and Fort Worth, could do more harm than good by energizing O’Rourke’s supporters.

Other locations would be more welcome, 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 one of politics’ leading odd couples.

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.

They 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 John F. 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 during the 2016 Republican National Convention, only to suddenly announce his support barely a month before Election Day 2016.

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.