LONDON — The London Metropolitan Police’s twitter account started acting very strangely.

The force’s official Twitter feed, which has 1.2 million followers, normally pushes out updates on arrests or appeals for information. In the event of a terrorist attack, the police use the social media platform as a way to update the public on the latest developments.

But late Friday, it suddenly began churning out something very different. “FREE DA GANG,” said one message that included an expletive at the beginning.

Another called for the release of Digga D, a drill rap artist who was jailed after he was caught with a group carrying machetes and baseball bats.

Arguably the cheekiest post read: “what you gonna do phone the police.”

The missives came to the attention of President Trump, who retweeted a screenshot of the tweets and appeared to point the finger of blame at the London mayor, Sadiq Khan, with whom he has long feuded. During his state visit to Britain last month, Trump called the mayor a “stone cold loser.”

“With the incompetent Mayor of London, you will never have safe streets!” Trump said, retweeting a post by Katie Hopkins, a far-right British commentator.

Trump has come under fire before for retweeting Hopkins, who has referred to London as “Stab-City” and “Khan’s Londonistan.”

David Lammy, a politician for the opposition Labour Party, accused Trump on Saturday of “amplifying the British far right.”

“My heart goes out to minorities living in the US under this fascist President,” he said.

The hacker tweets from the police account have since been deleted, but the security breach was clearly embarrassing for the force.

Police were unable to resolve the problem for over half an hour, even though they quickly flagged that something was amiss. Writing from his personal account on Friday night, Superintendent Roy Smith said that the feed had been “subject to unauthorized access” and urged the public to “ignore any Tweets until we verify that it is back under official control.”

A spokesman for Scotland Yard said that the force’s own internal infrastructure wasn’t hacked; instead, the breach involved a third-party site that it uses to issue news releases.

In an emailed statement, the force said, “Last night, Friday 19 July, unauthorised messages appeared on the news section of our website as well as on the @metpoliceuk Twitter feed and in emails sent to subscribers.”

The police apologized to its followers for the messages and said that “we are assessing to establish what criminal offences have been committed.”