WASHINGTON — President Donald Trump’s visit to Arizona for a campaign-style rally Tuesday night has some Republicans on edge and concerned that his public feud with the state’s junior GOP senator, Jeff Flake, is putting the party's Senate majority at risk and sowing deeper internal divides.

Trump didn't mention Flake by name at the rally, he said, because Republicans urged him not to mention any names. But there was no mistaking whom he was attacking.

"Nobody wants me to talk about your other senator who's weak on border and weak on crime," Trump said, referring to Flake. "See I haven’t mentioned any names. So now everybody’s happy."

Flake is running for reelection next year in what is expected to be a highly competitive and critical contest for Senate Republicans who are looking to, at the very least, keep their governing majority in the upper chamber. But tensions have escalated in recent weeks between Trump and Flake as the president has used his bully pulpit to attack the senator and encourage a primary challenger while the Arizonan has promoted a new book that is highly critical of Trump's tone and rhetoric.

Flake will not attend Trump’s rally in Phoenix. Instead he’ll be about two hours south in Tucson. But Flake's GOP primary opponent, Kelli Ward, who Trump has publicly praised, will be there, hoping for a presidential endorsement — if not tonight, then soon

“I think the president and I see eye to eye on many issues, and so I’m working towards gaining that support and that endorsement,” Ward told NBC News. “We need some people in Washington, D.C., who support the president and his America first agenda.”

For Ward to get to Washington, she'll have to prevail in a primary that could drain the eventual nominee of energy and resources needed for the general election.

Flake and Trump have a history of bad blood. During Trump’s presidential campaign, Flake publicly criticized him and refused to attend his rallies in Arizona. Now, Trump appears to be returning the favor by making Flake’s reelection more difficult for 2018.

Just recently, Trump used his Twitter account to attack Flake, calling him “weak” and toxic” while praising Ward.

Great to see that Dr. Kelli Ward is running against Flake Jeff Flake, who is WEAK on borders, crime and a non-factor in Senate. He's toxic! — Donald J. Trump (@realDonaldTrump) August 17, 2017

That came days after Flake released a scathing new book criticizing the president, as well as the large numbers of Republicans who supported him. “Conservatism has been compromised" by a "stew of celebrity and authoritarianism,” Flake wrote in the recently released book “A Principled Conservative.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

In addition, Flake and Trump have disagreements on key issues like immigration and trade. Flake has defended free trade, telling reporters this week that "it's always easier" to criticize free trade in a political campaign. He also was a member of the Senate's Gang of Eight group of bipartisan senators who hashed out a compromise comprehensive immigration plan that passed the Senate in 2013 but died in the House.

Flake has also been critical of the president's tone and rhetoric. "You can have a partisan debate," he told reporters at an event outside of Phoenix on Monday. "But it can’t get ugly. And we’ve got to get away from calling our opponents losers or clowns — things that make it difficult to sit down and work with them on the big issues that we’ve got to work with them on.”

He insists that he’s not worried about Trump’s impact on his reelection bid.

“You know, I’m busy doing other things,” Flake said. “And we have a lot of support around the state. And we’ve got a good campaign so it’ll take care of itself.”

The feud, however, is pitting Republicans against each other. Some of Trump’s biggest financial backers, the Mercer family, has given $300,000 to a super PAC supporting Ward. Meanwhile, the Senate Leadership Fund, a super PAC allied with Senate Majority Leader Mitch McConnell, launched a digital ad Tuesday morning attacking Ward for supporting "chemtrail" conspiracy theories. “Embarrassing behavior, dangerous ideas. No wonder Republicans rejected her just one year ago,” the narrator in the ad says. “Chemtrail Kelli. Not conservative; just crazy ideas.”

Chris Pack, the spokesman with the Senate Leadership Fund, said that the timing of the ad buy was targeted to Trump’s visit to the state.

“Eyes will be on Arizona today so it’s a good time to weigh in and let the public and pundits know that we will not stand by and let a fringe candidate win the primary,” Pack said.

Republicans and observers are mystified at Trump’s focus on members of his own party.

“Tanking Republicans' chances in seats we need to hold and not focusing on Missouri and Indiana doesn’t get the White House any more votes,” said Republican political operative Michael Steel, referring to two states where Democratic senators are up for reelection in Republican-leaning states.

Presidents can harm members of their own party by the policies they push, such as President George W. Bush’s Iraq War and President Barack Obama’s Affordable Care Act, says Jennifer Duffy, senior editor at the Cook Political Report. However, she said, those battle wounds aren’t intentional.

“I don’t ever remember seeing a president hurting his own solely by politics,” she said. “Every time (Trump) attacks (Flake) it endangers his ability to win a primary. Even if he wins this primary, he’s more damaged and he has to spend more resources that could have been used in a general election.”

No Democratic candidate has announced yet but the most likely candidate is Rep. Kyrsten Sinema who represents the 9th District, including parts of Phoenix. Sinema, elected as a progressive, has moderated her voting record and voted against her party at times, including her opposition to Rep. Nancy Pelosi to be Democratic leader.

And other Republican candidates could jump in the Republican primary as well. Former Arizona Republican Party chairman who also ran Trump’s Arizona campaign, Robert Graham, is also considering a run. He said on MSNBC Tuesday that he hasn’t made a commitment yet but he’s doing “what we can to support the president.”

.@RobertSGraham on rumors of running against Sen. Flake: 'not ruling it out.' https://t.co/SuSY8CQPNQ — Hallie Jackson (@HallieJackson) August 22, 2017

Like Ward, Graham has spoken to White House officials about a challenge to Flake.

Trump’s rally, taking place in Phoenix Tuesday night, was scheduled just a few weeks after Trump was stung by both of Arizona’s senators. Sen. John McCain was the third and decisive vote against his party’s effort to repeal and replace the Affordable Care Act and then Flake released and promoted his critical book.

Trump won the Arizona with 48 percent of the vote last year compared to Hillary Clinton’s 44.6 percent. But complicating Arizona’s conservative politics is its libertarian streak. The home of Barry Goldwater gave Libertarian candidate Gary Johnson 4 percent.

That conservative streak often gives Republican statewide candidates difficult primaries. Ward ran against Sen. McCain in 2016 but lost. She won, however, 40 percent of the vote.

Flake is suffering from low approval ratings in the state. A poll by Morning Consult from last month shows Flake as more unpopular than Trump in the state among Republican and Independent voters and receiving only a 36 percent approval rating among all voters.

But Flake ally, Megan Cox who is a Republican political strategist, said that Flake doesn’t need Trump’s voters to win the primary.

“The voters that are with Sen. Flake have always been with him and Trump voters … likely aren’t Flake supporter,” Cox said. “I don’t think that Trump’s attack or non-endorsement hurts him.”

CORRECTION (Aug. 23, 11:30 a.m.): An earlier version of this article misspelled Rep. Sinema’s first name, it is Kyrsten, not Krysten. It also incorrectly described her congressional district, which includes parts of Phoenix, not her hometown of Tucson.

Vaughn Hillyard reported from Phoenix, Ariz.