WASHINGTON - Republican leaders gasped again this week at President Donald Trump's conduct, expressing horror at his scathing criticism of John McCain, the late Arizona senator and former GOP presidential nominee.

But to many Trump allies — and to Trump himself — it all makes perfect sense.

Inside the powerful and populist wing of the party that is most loyal to Trump, McCain is not a revered war hero but a useful foil — encapsulating everything his core voters have come to loathe about establishment Republicans, from their support for the Iraq War to their opposition to Trump’s nativist agenda to their esteem for the Justice Department as it oversees the ongoing Russia investigation.

By attacking McCain, Trump allies said Thursday, the president is stoking his supporters' rawest emotions and suspicions about the GOP's political elite.

"You're talking about a group of people who have felt powerless and voiceless for many years, until President Trump came along, and they're going to be loyal to him. It's part of the fabric of their life," said Mississippi state Sen. Chris McDaniel, a Republican who has run Trump-style insurgent campaigns in his state. "To those people, McCain was the embodiment of a lifetime career politician."

Mike Shields, a Republican consultant who has worked with Trump's political team, said Trump is tapping into how "a significant number of voters in this country have seen politicians that lie to them, make promises, are disingenuous, who are basically not themselves. They aren't real. When the president does things like this, he is real. There's a currency for that."

And there is an audience. On social media, Fox News and other conservative-leaning platforms, Trump's searing critiques of the late senator are acceptable to many rank-and-rile Republicans.

"There is a reason for those nasty remarks. There is a history between those two men," Fox Business Network host Lou Dobbs, who is friendly with Trump, said on his Thursday evening broadcast. He called critics of Trump over the McCain controversy "asinine."

McCain wanted to "stick it to the president" by voting against a GOP health care overhaul in 2017, Rep. Matt Gaetz, R-Fla., one of Trump's allies on Capitol Hill, told Fox News this week. "It's reasonable for the president to be very frustrated and let down by that."

When Donald Trump Jr., the president's eldest son, knocked Senate Minority Leader Charles Schumer, D-N.Y., on Twitter, he called him "Schmuck Schumer" for defending McCain and full of "crap" for being outraged, and drew more than 30,000 social media "likes" in the process.

There was no coordinated strategy among Senate Republicans this week to respond to Trump's continued attacks on their deceased colleague, senior aides said. The smattering of GOP senators who felt compelled to push back against Trump - whether on Twitter, in town halls or in radio interviews - have done so on their own.

Senate Majority Leader Mitch McConnell, R-Ky., who is up for re-election next year, called McCain "a rare patriot and genuine American hero in the Senate" amid Trump's attacks Wednesday, but he did not mention Trump in his statement.

Sen. Martha McSally, R-Ariz., who was appointed to the seat held by McCain, spoke privately to Trump on Wednesday to convey her sentiments about McCain, although a spokeswoman said McSally did not request anything from Trump, including stopping the attacks.

"There is a lot of disrespect going on out there all the way around," McSally told reporters in Arizona on Thursday. "I did talk to the president yesterday. I wanted to make sure he understood how I felt about Senator McCain and how Arizona felt about Senator John McCain, and he heard me."

Antonia Ferrier, a former senior McConnell aide, said that in today's GOP, McConnell and others like him find it difficult with Trump to "smack his wrist."

"There is no recourse because what kind of punishment can you do when a person is fundamentally a boxer?" Ferrier said. Republican leaders, she added, feel like "they've been down this path with the president before. He's not changing his mind."

Trump, meanwhile, has repeatedly assured his aides that McCain is not popular with his supporters and that the fallout is negligible, according to a senior Trump administration official who was not authorized to speak publicly.

Several Trump and GOP officials, who were not authorized to speak publicly, said Trump's animus is fueled by his own seething anger more than anything and by his long-held belief that McCain and his allies in the party have worked to undermine his presidency from the start.

"I'm not a fan," Trump reiterated on Thursday in an interview with Fox Business Network's Maria Bartiromo, listing his grievances. "What he did to the Republican Party and to the nation, and to sick people that could have had great health care, was not good."

Tim O'Brien, a Trump biographer, said Trump's dislike of McCain also likely stems from the two men's contrasting experiences during the Vietnam War, when McCain was captured and held prisoner for more than five years, while Trump received five draft deferments.

Some Trump advisers this week said the mere mention of McCain in the news can instantly bring about a grim atmosphere in the West Wing as Trump grouses about the coverage of the late senator. McCain's funeral in September prompted a particularly dark mood, they recalled, and Trump was irate about former White House Chief of Staff John Kelly's praise for McCain at the time.

Shields said Trump knows exactly what he's doing as he vents about perceived past slights from McCain.

"He knows he's going to offend people on TV. His supporters want those people to be offended. They elected him because he thought they were going to make them all really angry," Shields said, adding that he nonetheless would urge Trump to "drop" the McCain attacks and move on.

Ahead of the 2020 campaign season, Trump is "reaching for feelings out in the country about McCain that are much deeper," said veteran Republican strategist Ed Rollins.

"Trump knows there are a lot more anti-McCain people than pro-McCain people in the party, despite the Washington establishment looking back fondly," said Rollins, the chairman of the pro-Trump Great America super PAC. "He's turning to them and showing his solidarity with them, reminding them that he's an outsider who was able to win the White House."

Still, some of Trump's biggest supporters are increasingly uncomfortable with Trump's attacks and dismiss talk of political strategy, while acknowledging that Trump may pay little cost with his base.

"When Trump has a grudge, he just pounds away, whether it's smart or dumb, wise or foolish," former House Speaker Newt Gingrich, R-Georgia, said. "This is who he is, this is how he operates. "This isn't a strategy, but his behavior - and it's a waste of time to be fighting with McCain when you have all of these opportunities to pick fights with Democrats. It doesn't make sense at all."

"I do not appreciate his tweets," Sen. Joni Ernst, R-Iowa, said Thursday at a town hall event. "John McCain is a dear friend of mine. So, no, I don't agree with President Trump, and he does need to stop."

In the wake of Trump's latest remarks, Senate Democrats are renewing their effort to rename the Russell Senate Office Building after McCain, with Schumer announcing that he will reintroduce a measure to make that change in the coming days.

Other attempts to honor McCain appear to have gone dormant. McConnell announced shortly after McCain's death that he would bring together a bipartisan group to brainstorm ways to commemorate McCain after some Republican senators objected to renaming the building named for former senator Richard Russell, D-Ga. But no public announcement has since been made regarding such a group. Instead, McConnell has been talking with McCain's family about other ways to memorialize him, according to two people familiar with the discussions, who were not authorized to speak publicly.

A Fox News poll conducted a week before McCain died in August 2018 showed him popular nationally, with 52 percent of registered voters viewing him favorably, while 37 percent were unfavorable. That figure was down from a peak of 64 percent popularity in 2009, months after being defeated by President Obama.

Among Republican voters, however, McCain's popularity suffered following his criticism of Trump and he was much more popular among Democrats at the time of his death. The Fox poll found 60 percent of Democratic voters had a favorable view of McCain, compared with 41 percent of Republicans. Four years prior, a CNN-ORC poll showed that 58 percent of Republicans saw McCain favorably.

Sen. Lindsey Graham, R-S.C. — McCain’s close friend and a vocal Trump ally - has been thrust into the center of the debate.

"I don't know why he continues to do it. I have no idea. I don't think it's particularly helpful. I am trying to be helpful to him where I can," Graham said in an interview. "I've told him repeatedly what I think about Senator McCain."

Graham declined to comment further.

The Washington Post’s Scott Clement contributed to this report.