President Trump walks across the South Lawn of the White House to board Marine One on Nov. 29, 2017, as he heads to Missouri to pitch the Republican tax plan. (Jabin Botsford/The Washington Post)

President Trump this week disseminated on social media three inflammatory and unverified ­anti-Muslim videos, took glee in the firing of a news anchor for sexual harassment allegations despite facing more than a dozen of his own accusers and used a ceremony honoring Navajo war heroes to malign a senator with a derogatory nickname, “Pocahontas.”

Again and again, Trump veered far past the guardrails of presidential behavior. But despite the now-routine condemnations, the president is acting emboldened, as if he were impervious to the uproar he causes.

If there are consequences for his actions, Trump does not seem to feel their burden personally. The Republican tax bill appears on track for passage, putting the president on the cusp of his first major legislative achievement. Trump himself remains the ­highest-profile man accused of sexual improprieties to keep his job with no repercussions.

Trump has internalized the belief that he can largely operate with impunity, people close to him said. His political base cheers him on. Fellow Republican leaders largely stand by him. His staff scrambles to explain away his misbehavior — or even to laugh it off. And the White House disciplinarian, chief of staff John F. Kelly, has said it is not his job to control the president.

For years, Trump has fired off incendiary tweets and created self-sabotaging controversies. The pattern captures the musings of a man who traffics in conspiracy theories and alternate realities and who can’t resist inserting himself into any story line at any moment.

President Trump retweeted three anti-Muslim videos Nov. 29, posted by the far-right group 'Britain First.' Here's what you need to know about the videos. (Elyse Samuels,Deirdra O'Regan/The Washington Post)

“In an intensely polarized world, you can’t burn down the same house twice,” said Alex Castellanos, a GOP campaign consultant. “What has Donald Trump got to lose at this point?”

Castellanos added that for many voters, and especially Trump’s base, there’s an “upside” to his bellicosity. “A strong daddy bear is what a lot of voters want,” he said. “Right or wrong, at least he’s fighting for us.”

On Wednesday, Trump took to Twitter before sunrise to share three unverified videos with his 43.6 million followers that seemed designed to stoke anti-Muslim sentiments. He then relished in the firing of Matt Lauer from NBC’s “Today” show for allegations of sexual misconduct and fanned unsubstantiated rumors about three other NBC and MSNBC executives and personalities.

Two days earlier, Trump used a ceremony honoring the World War II Navajo code talkers to deride Sen. Elizabeth Warren (D-Mass.) by using his nickname for her, “Pocahontas.” Native American leaders and other Americans have objected to the characterization as a racial slur.

Trump traveled on Wednesday to Missouri, where he pitched the tax overhaul plan. He explained that he did not mind that the bill might close loopholes for the wealthy like himself.

Trump and other wealthy Americans are poised to benefit from the plan, according to tax experts, because of cuts to estate and business taxes and other relief for real estate holdings. Trump has refused to release his tax returns, so it is impossible to say exactly how he would benefit.

White House chief of staff John F. Kelly and staff secretary Rob Porter follow President Trump to Marine One on Nov. 29, 2017, before departing for a presidential event in Missouri (Jabin Botsford/The Washington Post)

In Missouri, he was talking about taxes, but he might as well been describing his mind-set.

“Hey, look, I’m president,” Trump said. “I don’t care. I don’t care anymore.”

Trump’s anti-Islam tweets on Wednesday — he retweeted videos first posted by a leader of the far-right Britain First party, an extremist group that targets mosques and Muslims — earned him a sharp rebuke from the British prime minister’s office.

The retweets also caught his West Wing team off guard. One aide said staffers were unsure exactly how to respond to — let alone defend — his tweets, while another noted that the tweets were unexpected but not necessarily out of character.

“He got pretty fired up this morning,” said the second aide, who spoke on the condition of anonymity to offer a candid assessment. “This was not planned.”

White House spokeswoman Sarah Huckabee Sanders defended Trump’s post as evidence that he wants to “promote strong borders and strong national security.” But she sidestepped questions on whether the president should give his Twitter endorsement to content whose authenticity was not verified.

“Whether it’s a real video, the threat is real, and that is what the president is talking about,” Sanders told reporters.

Jason Miller, a former Trump campaign adviser, said the media were overreacting to the president’s sharing of anti-Muslim videos. “A very small number of people, primarily in New York and Washington, are complaining about the origin of the tweets, and most of the rest of the country is talking about the need for stricter border security and the threat of radical Islamic terrorism,” Miller said.

Still, by sharing the videos, Trump created problems for himself. He undermined the administration’s legal strategy in defending the controversial entry ban by offering evidence of anti-Muslim bias. Federal judges have blocked various versions of the ban because it is akin to an unconstitutional ban on Muslims, which Trump had called for during the campaign.

One of Trump’s aides, deputy press secretary Raj Shah, also may have complicated the legal strategy. Aboard Air Force One on Wednesday, Shah answered a reporter’s question about whether Trump thinks Muslims are a threat to the United States by saying, “No, look, the president has addressed these issues with the travel order that he issued earlier this year and the companion proclamation.”

Trump also strained, at least temporarily, the special relationship with Britain. A spokesman for British Prime Minister Theresa May delivered a rare rebuke from 10 Downing Street: “British people overwhelmingly reject the prejudiced rhetoric of the far-right which is the antithesis of the values that this country represents: decency, tolerance and respect.”

On Wednesday evening, Trump responded on Twitter: “Theresa May, don’t focus on me, focus on the destructive Radical Islamic Terrorism that is taking place within the United Kingdom. We are doing just fine!”

Trump’s advisers and friends said he feels emboldened, even invincible, to communicate as he chooses — especially on cultural issues, believing that his stances work for him politically by galvanizing his base.

Having long trafficked in conspiracy theories — his political rise was fueled by his role as one of the nation’s leading champions of the false claim that President Barack Obama was not born in the United States — Trump continues as president to promote falsehoods and reject facts.

Trump has recently told friends that he believes special counsel Robert S. Mueller III’s Russia investigation will be winding down by the end of the year and that he will be exonerated, even though many experts and others close to the wide-ranging probe say that view is overly optimistic.

Trump has watched as other high-profile men’s careers have crumbled under the weight of public accusations of sexual misconduct. Yet Trump has faced no disciplinary repercussions, even after bragging on a 2005 tape about having sexually assaulted women. “Grab ’em by the p---y. You can do anything,” Trump told “Access Hollywood” host Billy Bush, who lost his job over the incident.

During the 2016 campaign, more than 12 women publicly came forward with claims that Trump had sexually harassed or assaulted them. Yet Trump categorically denied the women’s accounts and won the election.

Trump occasionally has even speculated, in private conversations with advisers and friends over the past year, that the voice in the tape may not be his or that the tape may have been unfairly doctored.

Roger Stone, a former political adviser to and longtime friend of Trump’s, said the president is less strategic and more spontaneous with his controversial comments.

“I just think you’re seeing the president as way too Machiavellian,” Stone said. “He doesn’t necessarily have a strategy. His instincts on the news cycle and how to tweak his enemies is extraordinary. . . . He’s a master marketer, and the only thing worse than being wrong is being boring. We’re talking about this now.”

Trump feels especially liberated when he is at Mar-a-Lago, his lush seaside resort in Palm Beach, Fla., where he spent the Thanksgiving holiday, according to his friends. There, Trump enjoys a less structured and disciplined environment than at the White House, where Kelly attempts to tightly control whom the president sees and what information he receives.

In Palm Beach, friends and club members can approach Trump at will and plant ideas in the president’s head, which he sometimes repeats or acts on.

Two outside advisers to Trump suspected it was no coincidence that he returned to Washington on Sunday night and soon thereafter struck a pugnacious tone in his public comments.

“Mar-a-Lago stirs him up,” said one of the advisers, who spoke on the condition of anonymity to be candid.

On Capitol Hill, Republicans struggled Wednesday to defend the president. Sen. Lindsey O. Graham (R-S.C.) said Trump’s retweets of the videos were “particularly unhelpful.”

“We don’t want to take a fringe group and elevate their content,” Graham said. “I think it also is not the message we need to be sending right now where we need, you know, Muslim allies.”

Sen. Jeff Flake (R-Ariz.), an outspoken Trump critic, agreed: “I just thought it was highly inappropriate. Not helpful.”

GOP strategist John Brabender said Trump’s tweets distracted from his agenda to pass a tax cuts bill and focus on the nuclear threat from North Korea. But, Brabender said, “this is not new in Donald Trump’s world.”

“We’re seeing the message hijacked by the messenger,” Brabender said. “That’s been problematic for a long time and it’s still problematic. . . . Sometimes we all just scratch our heads.”

Sean Sullivan contributed to this report.