The White House has defended President Donald Trump’s controversial string of tweets following the recent terrorist attack in London.

The president issued several early-morning missives about the attack, in which he lashed out at London Mayor Sadiq Khan and referred to his own proposed travel restrictions as a “travel ban”. Many accused Mr Trump of politicising the tragedy and using it to further his own aims.

White House Deputy Press Secretary Sarah Huckabee Sanders, however, defended the president’s tweets, saying they allow him to “speak directly to the people without the bias of the media filtering those communications.”

Hours before, Mr Trump had used the social media platform to criticise Mr Khan’s calls for calm.

“At least 7 dead and 48 wounded in terror attack and Mayor of London says there is ‘no reason to be alarmed!’” Mr Trump tweeted. The mayor had been referring to the increased police presence in the city.

Later, Mr Trump tweeted about Mr Khan’s “pathetic excuse” for his statement, claiming the mainstream media was “working hard to sell it”.

Ms Sanders echoed these statements, saying the president was not “picking a fight” with Mr Khan, but that “the media wants to spin it that way”.

She also denied the accusation that the president had singled out Mr Khan because of his Muslim faith.

In the same press conference, however, Ms Sanders defended Mr Trump’s proposed restrictions on entry for residents of six Muslim-majority countries. She adopted Mr Trump's own language from that morning, in which he referred to the restrictions as a "travel ban".

"One of the reasons we have the travel ban here, through this executive order, is a focus on national security," she said.

London Bridge Terror Attack Show all 16 1 /16 London Bridge Terror Attack London Bridge Terror Attack Armed police on Borough High Street as police are dealing with a "major incident" at London Bridge PA London Bridge Terror Attack Armed Police talk to members of the public outside London Bridge Hospital as police are dealing with a "major incident" at London Bridge PA London Bridge Terror Attack Police Officers outside the Barrowboy and Banker Public House on Borough High Street as police are dealing with a "major incident" at London Bridge PA London Bridge Terror Attack Armed Police talk to members of the public outside London Bridge Hospital as police are dealing with a "major incident" at London Bridge PA London Bridge Terror Attack Armed police on Borough High Street as police deal with a 'major incident' at London Bridge PA London Bridge Terror Attack Emergency services near the scene of the incident Screengrab London Bridge Terror Attack People run down Borough High Street as police are dealing with a "major incident" at London Bridge Reuters London Bridge Terror Attack Emergency services arrive at the scene near Borough market at London Bridge Carl Court/Getty Images London Bridge Terror Attack Emergency personnel on London Bridge as police are dealing with a "major incident" at London Bridge PA London Bridge Terror Attack Police sniffer dogs on London Bridge as police are dealing with a "major incident" at London Bridge PA London Bridge Terror Attack A second helicopter lands on London Bridge as police are responding to three incidents in the capital, amid reports that a vehicle collided with pedestrians on London Bridge, Scotland Yard said. Officers are dealing with reports of stabbings in Borough Market, where armed officers attended and shots were fired. They are also at an incident in the Vauxhall area PA London Bridge Terror Attack Police attend to an incident on London Bridge in London REUTERS London Bridge Terror Attack Police attend to an incident on London Bridge in London, Britain Reuters London Bridge Terror Attack A police officer escorts members of the public to safety at London Bridge Getty Images London Bridge Terror Attack Police attend to an incident on London Bridge in London, Britain Reuters London Bridge Terror Attack Police attend to an incident near London Bridge in London, Britain Reuters

Much of the debate about Mr Trump's restrictions – which have been blocked by multiple federal judges – centres on whether they amount to a "Muslim ban". A ban on any religion by the US government would be unconstitutional.

White House Press Secretary Sean Spicer has previously insisted that the executive order is "not a Muslim ban" and "not a travel ban".

But Ms Sanders co-opted the president's own language on Monday, referring to the order as a travel ban and denying the term was problematic.

“The president isn’t concerned with what you call it, he’s concerned with national security and protecting people in this country,” Ms Sanders said.