WASHINGTON — President Donald Trump on Friday demonstrated the limited influence of allies or advisers who try to steer him away from preelection racial and cultural fights. He walked back his disavowal of a racially loaded chant at a campaign rally less than 24 hours after making it.

Acquiescing to behind-the-scenes pressure from nervous Republican lawmakers and from his elder daughter, Ivanka Trump, the president distanced himself Thursday from the chant of “Send her back!” that the crowd at his rally Wednesday in Greenville, North Carolina, directed at Rep. Ilhan Omar, D-Minn., who was born in Somalia. Trump said he was “not happy” with the chant’s language and claimed, falsely, that he had tried to cut it off.

But Friday, the president appeared to disavow his disavowal — following the same three-stage crisis playbook he used after setting off a wave of criticism when he defended neo-Nazi protesters in 2017 Charlottesville, Virginia.

“No, you know what I’m unhappy with — the fact that a congresswoman can hate our country,” Trump said Friday, referring to Omar, when he was asked about the chant condemned by Republicans as well as Democrats. “I’m unhappy with the fact that a congresswoman can say anti-Semitic things. I’m unhappy with the fact that a congresswoman, in this case a different congresswoman, can call our country and our people ‘garbage.’ That’s what I’m unhappy with.”

Trump defended the crowd as “incredible patriots” and said that Omar, who was elected last November, was “lucky to be where she is.”

When asked about the chant again later in the day as he left Washington to spend the weekend at his golf club in Bedminster, New Jersey, Trump refused to condemn them. Instead, he seemed to be repeating his criticism of Omar and her allies in Congress without mentioning any names.

“You know what’s racist to me, when someone goes out and says the horrible things about our country,” he said. “The people of our country that are anti-Semitic, that hate everybody, that speak with scorn and hate — that to me is really a dangerous thing.”

The reversal followed the same pattern as the one after Charlottesville.

After Trump’s original response to the violence that took place there in August 2017, a low point of his presidency, aides urged him to take the high ground. Days later, he finally relented, reading a brief prepared statement from the Diplomatic Room in the White House in which he, for the first time, unequivocally condemned neo-Nazi groups and stated that “racism is evil.”

But the next day, he reverted to his original stance in a combative exchange with reporters in which he again blamed both sides for the violence that left one demonstrator dead and dozens injured. But while business leaders and Republican lawmakers briefly distanced themselves from the president at the time, Trump appears to have suffered little long-term political damage because of the episode — and that lesson appears to have made an impression.

“It just destroys him to seem to be abandoning his base on any issue,” said Douglas Brinkley, the presidential historian. “When he originally said he distanced himself from the chant at the rally, one could have guessed he would go back and embrace the people who cheered ‘Send her back!’ Contrite is not in his playbook.”

But even some critics of Trump said that the walkback of the walkback was not necessarily damaging to him. “I wish I could say it was foolish, but what have been the actual consequences been in the real world or in Republican support of him sticking to his guns?” said William Kristol, the conservative columnist and prominent Trump opponent. “Being the tough, unapologetic guy, it keeps his brand stronger even if he takes a little bit of a hit.”

Trump continued his condemnation of Omar on Friday, claiming that she had “called our country and our people garbage.” It was not clear what remarks she made that he was referring to.

That attack continued his racially charged fight with Omar and three of her fellow Democratic congresswomen of color — Reps. Alexandria Ocasio-Cortez of New York, Ayanna S. Pressley of Massachusetts and Rashida Tlaib of Michigan — into a sixth day.

Administration officials and campaign aides have rejected comparisons between Trump’s goading of elected women of color to “go back” to where they came from and what happened in Charlottesville. One was a deadly incident, they said, the other was a political fight.

But campaign aides have acknowledged that Trump’s tweets on Sunday — in which he used an age-old racist adage in telling the congresswomen to “go back and help fix the totally broken and crime infested places from which they came” — were unexpected, used loaded and unhelpful language, and any political strategy attached to them was reverse-engineered after the fact.

The president claimed his attacks were not politically motivated. “I don’t know if it’s good or bad politically; I don’t care,” he said. “I can tell you this, you can’t talk that way about our country. Not when I’m the president.”

While Republican lawmakers expressed outrage over what his supporters chanted in North Carolina, they kept their criticism of Trump to themselves.

Trump’s aides and allies did their advising in private, but his changing message made it hard for them to know whether they were on the same page as the man they work for.

One campaign aide, Mercedes Schlapp, retweeted criticism of the chant, prompting a commentator on Twitter to write that Omar was “an American citizen and chanting for her deportation based on her exercise of the First Amendment is disgusting.” On Friday, Schlapp said she stood by that tweet.

“I agree with the president on not going forward with the chant,” she said.

“When you look at her policies,” she said, referring to Omar, “that’s the problem. Her policies themselves are dangerous for America, and that’s what we’re concerned about.”

This article originally appeared in The New York Times.