President Trump took to Twitter early Friday to condemn Minneapolis demonstrators as “THUGS,” threaten military intervention and predict local looting could lead to “shooting,” prompting the social-media company to take the unprecedented step of limiting the public’s ability to view and share his tweet.

The label Twitter appended -- which the company also added later to a tweet from the White House -- marks the second time in a week the tech giant has taken action in response to Trump’s controversial remarks. Trump and his allies again decried the move as censorship, promising to regulate the company a day after he signed an executive order that could open the door for the U.S. government to punish social-media sites for their handling of political speech online.

Trump fired off his early morning comment as protests over the death of George Floyd intensified in Minneapolis. Fires raged across the city Thursday night as demonstrators took to the streets because Floyd, who was black, died in police custody. The unrest has reverberated nationwide, including in Louisville, where Breonna Taylor, a black woman and aspiring nurse, was killed by police in March.

“These THUGS are dishonoring the memory of George Floyd, and I won’t let that happen,” Trump tweeted shortly before 1 a.m. Friday, adding, “Any difficulty and we will assume control but, when the looting starts, the shooting starts."

Critics immediately condemned Trump’s tweet, asserting that he was promoting violent retaliation against protesters, and Twitter took swift action. “This Tweet violated the Twitter Rules about glorifying violence,” read a gray box that now hides Trump’s tweet from public view unless a user clicks to see it. In doing so, Twitter also prevented other users from liking the president’s tweet or sharing it without appending comment.

“We’ve taken action in the interest of preventing others from being inspired to commit violent acts, but have kept the tweet on Twitter because it is important that the public still be able to see the Tweet given its relevance to ongoing matters of public importance,” said Trenton Kennedy, a spokesman for the company.

In an act of defiance, the White House hours later reposted a quotation of the president’s controversial comment about shootings on its account. That, too, received a label from Twitter indicating it broke company rules around glorifying violence.

A White House spokesman did not respond to a request for comment.

The dispute immediately exacerbated tensions between the Silicon Valley company and Trump, who tweeted later Friday morning that he had been unfairly targeted. For years, the president has maintained Twitter and other tech companies exhibit bias against conservatives, systematically limiting their posts and quietly banning right-leaning users — a charge for which Trump has provided little evidence, and one that the industry strongly denies.

But their dispute took on greater significance on Tuesday, after Twitter bowed to years of public pressure and sought to fact check one of the presidents remarks for the first time. The company appended a link to news articles to two of Trump’s tweets about alleged election fraud, sparking fierce blowback among Trump and his allies.

Twitter in recent days has taken similar action against tweets from other sources across the political spectrum. But Trump has maintained it is a form of censorship, and his concerns led him Thursday to executive order targeting Section 230, a portion of federal law that shields Twitter and other tech firms from most liability for the content they allow or take down. Critics say the order threatens free expression on the web, running afoul of the Constitution.

“Twitter is doing nothing about all of the lies & propaganda being put out by China or the Radical Left Democrat Party,” Trump said in a later tweet. “They have targeted Republicans, Conservatives & the President of the United States. Section 230 should be revoked by Congress. Until then, it will be regulated!"

Trump’s late-night tweet about Minneapolis, which was paired with another blistering post targeting Mayor Jacob Frey (D), came after protesters in the city breached a police precinct that had been evacuated and set fire to the building. The chaotic scenes marked the latest escalation of the widespread unrest that has plagued Minneapolis for three straight days following a fatal incident in which Floyd, an unarmed black man, died after a white police officer knelt on his neck for minutes as he was handcuffed on the ground.

On Thursday, amid reports of fires, looting and vandalism that had begun the night before, Frey declared an emergency, which was soon followed by Democratic Gov. Tim Walz’s order to call in the National Guard. By nightfall, more than 500 soldiers had been deployed to Minneapolis, St. Paul and surrounding communities, the Guard confirmed.

But protesters continued wreaking havoc in the city Thursday night — much to Trump’s dismay.

“I can’t stand back & watch this happen to a great American City, Minneapolis,” Trump tweeted early Friday, before taking aim at Frey.

“A total lack of leadership,” the president continued. “Either the very weak Radical Left Mayor, Jacob Frey, get his act together and bring the City under control, or I will send in the National Guard & get the job done right.”

Then, Trump called the demonstrators, many of whom are people of color, “THUGS” before parroting the words of former Miami police chief Walter Headley, who was known for his controversial “stop and frisk” policies.

The looting and shooting quote was first said by Headley during a December 1967 news conference addressing efforts by authorities to carry out what United Press International described at the time as a “crackdown on … slum hoodlums.” According to UPI, “Headley said Miami hasn’t been troubled with racial disturbances and looting because he let the word filter down, ‘When the looting starts, the shooting starts.’ ”

The moment has since been cited as a prime factor in the discontent that contributed to the race riots that broke out in Miami in the late 1960s, The Washington Post’s Terence McArdle reported.

On Thursday, many accused Trump of making a racist threat of violence against the protesters.

Even the Oath Keepers, a right-wing militia group, urged Trump to retract his statement, citing concerns that the tweet could be seen as encouraging the National Guard to “shoot people for stealing.”

“This is a disaster,” the group tweeted from their official account. “President Trump needs to retract that statement ASAP, stating that he misspoke & did not mean to say that National Guard should shoot people for stealing.”

Meanwhile, Frey hit back at the president during a news briefing early Friday.

“Donald Trump knows nothing about the strength of Minneapolis. We are strong as hell,” Frey said. “Is this a difficult time period? Yes. But you better be damn sure we’re going to get through this.”

Timothy Bella contributed to this report.

Correction: A previous version of this story misstated the date of Breonna Taylor’s death. She died in March.