The company prevented users from viewing Mr. Trump’s message without first reading a brief notice describing the rule violation. Twitter also blocked users from liking or replying to Mr. Trump’s post.
But Twitter did not take the tweet down, saying it was in the public’s interest that the message remain accessible.
Twitter said that it had made its decision “based on the historical context of the last line, its connection to violence, and the risk it could inspire similar actions today.”
In the tweet, posted early Friday morning, Mr. Trump called the protesters “thugs” and said he had told Minnesota’s governor that the military was “with him all the way.”
“Any difficulty and we will assume control but, when the looting starts, the shooting starts,” the president wrote. “Thank you!”
The company’s decision comes a day after Mr. Trump signed an executive order that seeks to to limit the legal protections that shield social media companies from liability for the content posted on their platforms. The president had fulminated over Twitter’s decision earlier this week to add fact-checking labels for the first time to two of his tweets. In response, he accused Twitter of stifling speech and said that he would put a stop to the interference.
Mr. Trump’s tweet about the Minneapolis protests echoed a comment by Walter E. Headley, the Miami police chief who attracted national attention in the late 1960s for using shotguns, dogs and other heavy-handed policies to fight crime in the city’s black neighborhoods.
Mr. Headley announced a “get tough” campaign in a December 1967 news conference that prompted angry reactions from black leaders, The New York Times reported at the time.
“We haven’t had any serious problems with civil uprising and looting,” he said, “because I’ve let the word filter down that when the looting starts, the shooting starts.”
“We don’t mind being accused of police brutality,” Mr. Headley also said at that news conference. “They haven’t seen anything yet.”
In Mr. Trump’s tweets about the Minneapolis protests, the president criticized Mayor Jacob Frey’s response to the demonstrations.
“I can’t stand back & watch this happen to a great American City,” the president wrote. Mr. Trump said Mr. Frey, a Democrat, must “get his act together and bring the City under control, or I will send in the National Guard & get the job done right.”
It was unclear if the president intended to send additional troops after Gov. Tim Walz activated the Minnesota National Guard to help restore order in the Twin Cities.
Mr. Trump had previously described the video of Mr. Floyd’s death as a “very shocking sight” and “a very very sad event,” saying he had asked the F.B.I.’s investigation to be expedited.
Mr. Frey did not know about Mr. Trump’s tweets until a reporter read them aloud during a news conference early on Friday. The mayor shook his head and then gave a fiery retort, slamming a podium for emphasis.
“Weakness is refusing to take responsibility for your own actions,” he said. “Weakness is pointing your finger at somebody else during a time of crisis.”
“Donald Trump knows nothing about the strength of Minneapolis,” he continued. “We are strong as hell. Is this a difficult time period? Yes. But you better be damn sure that we’re going to get through this.”