WASHINGTON — Inside the White House, the mood was bristling with tension. Hundreds of protesters were gathering outside the gates, shouting curses at President Trump and in some cases throwing bricks and bottles. Nervous for his safety, Secret Service agents abruptly rushed the president to the underground bunker used in the past during terrorist attacks.

The scene on Friday night, described by a person with firsthand knowledge, kicked off an uneasy weekend at the White House as demonstrations spread after the brutal death of a black man in police custody under a white officer’s knee. While in the end officials said they were never really in danger, Mr. Trump and his family have been rattled by protests near the Executive Mansion that turned violent for a third night on Sunday.
After days in which the empathy he expressed for George Floyd, the man killed, was overshadowed by his combative threats to ramp up violence against looters and rioters, Mr. Trump spent Sunday out of sight, even as some of his campaign advisers were recommending that he deliver a nationally televised address before another night of violence. The building was even emptier than usual as some White House officials planning to work were told not to come in case of renewed unrest.

Thousands of protesters demonstrated peacefully near the White House during the day, but by nightfall, with hundreds still in the streets, the scene turned more volatile as crowds surged forward against lines of riot police with plastic shields as the two sides vied for control of Lafayette Square across from the White House. Protesters threw water bottles, set off fireworks and burned a pile of wood and at least one car.

One of the fires on H Street NW a block from the White House may have spread because soon afterward flames erupted in the basement of St. John’s Episcopal Church, the iconic “church of presidents” attended at least once by every chief executive going back to James Madison, but were soon doused by firefighters. Businesses far away from the White House boarded up to guard against vandalism, and Mayor Muriel E. Bowser ordered an 11 p.m. curfew. The White House turned off at least some of its exterior lights.

Mr. Trump remained cloistered inside, periodically sending out Twitter messages like “LAW & ORDER!” until the evening, when he went quiet. While some aides urged him to keep off Twitter, Mr. Trump could not resist blasting out a string of messages earlier in the day berating Democrats for not being tough enough and attributing the turmoil to radical leftists.

“Get tough Democrat Mayors and Governors,” he wrote. Referring to his presumptive Democratic presidential opponent, former Vice President Joseph R. Biden Jr., he added: “These people are ANARCHISTS. Call in our National Guard NOW. The World is watching and laughing at you and Sleepy Joe. Is this what America wants? NO!!!”

The president said his administration “will be designating ANTIFA as a Terrorist Organization,” referring to the shorthand for “anti-fascist,” and scheduled a meeting with Attorney General William P. Barr for Monday morning. But antifa is a movement of activists who dress in black and have used tactics similar to those of anarchists, not an organization with a clear structure that can be penalized under law. Moreover, American law applies terrorist designations to foreign entities, not domestic groups.

By targeting antifa, however, Mr. Trump effectively paints all the protests with the brush of violent radicalism without addressing the underlying conditions that have driven many people to the streets. Demonstrations have broken out in at least 75 cities in recent days, with governors and mayors deploying the National Guard or imposing curfews on a scale not seen since the aftermath of the assassination of the Rev. Dr. Martin Luther King Jr. in 1968.

While Mr. Trump has been a focus of anger, particularly among the crowds in Washington, aides repeatedly have tried to explain to him that the protests were not only about him, but about broader, systemic issues related to race, according to several people familiar with the discussions. Privately, advisers complained about his tweets, acknowledging that they were pouring fuel on an already incendiary situation.

“Those are not constructive tweets, without any question,” Senator Tim Scott of South Carolina, the only black Republican in the Senate, said in an interview on “Fox News Sunday.” “I’m thankful that we can have the conversation. We don’t always agree on any of his tweets beforehand, but we have the ability to sit down and dialogue on how we move this nation forward.”

Dan Eberhart, a Republican donor and supporter of Mr. Trump, said the president, with election looming in five months, is focused on catering to his core supporters rather than the nation at large. “Trump is far more divisive than past presidents,” Mr. Eberhart said. “His strength is stirring up his base, not calming the waters.”

Robert C. O’Brien, the president’s national security adviser, said the president would continue “to take a strong stand for law and order” even as he understood the anger over Mr. Floyd’s death.

“We want peaceful protesters who have real concerns about brutality and racism. They need to be able to go to the city hall. They need to be able to petition their government and let their voices be heard,” Mr. O’Brien said on “State of the Union” on CNN. “And they can’t be hijacked by these left-wing antifa militants who are burning down primarily communities in the African-American sections and the Hispanic sections of our city.”

But Mr. Trump’s absence rankled the Democrats he was criticizing.

“What I’d like to hear from the president is leadership,” Mayor Keisha Lance Bottoms of Atlanta said on “Meet the Press” on NBC. “And I would like to hear a genuine care and concern for our communities and where we are with race relations in America.”

Some officials were urging that Mr. Trump hold events to show black voters enraged over the latest videotaped act of brutality that he heard their views. A group of advisers discussed plans for a series of “listening” events. But others have counseled that the president should take a hard line, not quite as aggressive as his tweets but a message of solidarity to business owners whose property has been destroyed.

Some in the president’s circle see the escalations as a political boon, much in the way Richard M. Nixon won the presidency on a law-and-order platform after the 1968 riots. One adviser to Mr. Trump, who insisted on anonymity to describe private conversations, said images of widespread destruction could be helpful to the law-and-order message that Mr. Trump has projected since his 2016 campaign.

The adviser said that it could particularly appeal to older women at a time when Mr. Trump’s support among seniors has eroded amid the coronavirus pandemic, which has disproportionately affected them. The risk, this adviser added, is that people are worn out by the president’s behavior.

The difference is that, unlike Mr. Nixon, Mr. Trump is the incumbent. And other advisers said most top aides were unhappy with Mr. Trump’s 1 a.m. tweet on Friday invoking a 1967 quote from a Miami police chief about “shooting” black people during civil unrest. Those advisers said it was far from certain that Mr. Trump could use the violent outbreaks in cities to improve his weak standing with suburban women and independent voters.

The election was clearly on the president’s mind on Sunday. In response to questions about what he was doing to address the tumult, Mr. Trump forwarded a reply through an aide that focused on the upcoming campaign.

“I’m going to win the election easily,” the president said. “The economy is going to start to get good and then great, better than ever before. I’m getting more judges appointed by the week, including two Supreme Court justices, and I’ll have close to 300 judges by the end of the year.” (So far he has confirmed about 200.)

An administration official said Mr. Trump met on Sunday with generals to discuss a variety of matters and talked with world leaders as he considered how to restructure the annual Group of 7 international summit that he decided to postpone. Mr. Trump will join Vice President Mike Pence on a previously scheduled conference call with governors on Monday as part of the coronavirus response, and the unrest is expected to be discussed.

Some campaign advisers were pressing for a formal address to the nation as early as Sunday. But White House officials, recalling Mr. Trump’s error-filled Oval Office address in March about the spread of the coronavirus, cautioned that it was not necessary. Mr. Trump quizzed advisers throughout the day about whether he should give an Oval Office address.

Mr. Trump already tried to recalibrate by ripping up his speech at the Kennedy Space Center on Saturday after the launch of the new crewed SpaceX rocket and adding a long passage about Mr. Floyd. In the speech, Mr. Trump repeated his calls for law and order, but in more measured terms and leavened by expressions of sympathy for Mr. Floyd’s family, whom he had called to offer condolences.

Aides were disappointed that the remarks, delivered late Saturday afternoon as part of a speech otherwise celebrating the triumph of the space program, did not get wider attention, but they said they hoped they would break through. Several administration officials said Mr. Trump was genuinely horrified by the video of Mr. Floyd’s last minutes, mentioning it several times in private conversations over the last few days.

Mr. Trump and his team seemed taken off guard by the protests that materialized outside the White House on Friday night. Hundreds of people surged toward the White House as Secret Service and United States Park Police officers sought to block them. Bricks and bottles were thrown, and the police responded with pepper spray. At one point, an official said, a barricade near the Treasury Department next door to the White House was penetrated.

It was not clear what specifically prompted the Secret Service to whisk Mr. Trump to the Presidential Emergency Operations Center, as the underground bunker is known, but the agency has protocols for protecting the president when the building is threatened.

Judd Deere, a White House spokesman, said officials would not comment on whether Mr. Trump was taken to the underground bunker. “The White House does not comment on security protocols and decisions,” Mr. Deere said.

Vice President Dick Cheney was brought to the bunker on Sept. 11, 2001, when the authorities feared one of the planes hijacked by Al Qaeda was heading toward the White House. President George W. Bush, who was out of town until that evening, was rushed there later that night after a false alarm of another plane threat.

The bunker has not been used much, if at all, since those early days of the war on terrorism, but it has been hardened to withstand the force of a passenger jet crashing into the mansion above.

The president and his family were rattled by their experience on Friday night, according to several advisers.

After his evening in the bunker, Mr. Trump emerged on Saturday morning to boast that he never felt unsafe and vow to sic “vicious dogs” and “ominous weapons” on intruders. Melania Trump opted not to travel to Florida for the rocket launch. One person briefed on the events said the first lady, anxious about the protests, made the decision at the last minute, but another person briefed on what took place disputed that.

After Mr. Trump returned to the White House from Florida on Saturday, he found a White House again under siege. This time, security was ready. Washington police blocked off roads for blocks around the building, while hundreds of police officers and National Guard troops ringed the exterior perimeter wearing helmets and riot gear and holding up plastic shields.

The scene was similar Sunday night as well. Protesters shouted “no justice, no peace,” and “black lives matter” as well as chanting expletives at Mr. Trump. Washington icons like the Hay-Adams Hotel and the Oval Room restaurant, damaged from the night before, were boarded up.

Graffiti was spray-painted for blocks, including on the historic Decatur House a block from the White House: “Why do we have to keep telling you black lives matter?”