Jeremy Hunt has vigorously defended Donald Trump for quoting the far-right commentator Katie Hopkins in an attack on the London mayor, Sadiq Khan, as Downing Street initially declined to condemn the US president’s words.

The foreign secretary said he would not have used the same words as Trump but he would “150% agree” with the overall sentiment.

The Hopkins post referred to the capital as “Khan’s Londonistan” and “stab-city”, after the deaths of three men in separate attacks on Friday and Saturday.

Trump then sent a tweet of his own a few hours later saying Khan was “a national disgrace who is destroying the City of London”.

The home secretary, Sajid Javid, said the US president should “stick to domestic politics”. After initially refusing to condemn the messages, No 10 later said Theresa May would not retweet Hopkins or use such language.

Hunt partly reversed his position, retweeting a message from the former Tory party chair Sayeeda Warsi in which she said Hunt had privately assured her that he “abhors Katie Hopkins, her disgusting views and everything she stands for.”

In a second tweet, Warsi said of Hunt: “He believes the term Londonistan is offensive and would never endorse sentiments that try and frame London’s knife crime challenge as a racial or religious phenomenon.”

There was no direct comment from Hunt, or criticism of Trump for retweeting Hopkins’ message.

The Muslim Council of Britain (MCB) said the stance of Hunt and No 10 was shocking and showed the Conservative party had a serious problem with Islamophobia. In 2017 May swiftly criticised Trump after he forwarded videos from the far-right group Britain First.

Does Jeremy Hunt actually want to kill old people? Read more

Asked about the Hopkins and Trump tweets during a media hustings event for Conservative leadership candidates in parliament on Monday, Hunt said: “President Trump has his own style. I wouldn’t use those words myself, but the sentiment is enormous disappointment that we have a mayor of London who has completely failed to tackle knife crime, and spent more time on politics than the actual business of making London safer, and in that I 150% agree with the president.”

Asked whether No 10 had any views on Trump’s tweets, May’s spokesman said: “It’s a matter for the US in terms of what events they comment upon. Politicians in the UK comment upon events in the US.”

However, later the spokesman added: “The prime minister would not retweet Katie Hopkins, nor use that language.”

Khan told Channel 4 News: “I’m too busy running London to worry about what the president tweets, except when it’s him amplifying the messages from far-right activists”

An MCB spokesman said: “When facing Islamophobia, many Muslims are most hurt when others stand by and do nothing. Trump’s endorsement of a bigot has nothing to do with the rising knife crime that we all are concerned about and everything to do with his divisive agenda.

“For Downing Street to refuse to comment and our foreign secretary and potentially future prime minister to agree with the ‘sentiment’ of this known Islamophobe, without condemning the clear bigoted intent behind it, is shocking. It is still further proof that Islamophobia is given a free pass at the highest echelons of the Conservative party.”

During the media hustings, Javid criticised Trump. He said: “I think that President Trump should stick to domestic politics. I think it’s unbecoming for a leader of such a great state to keep trying to interfere in other countries’ domestic policies.

“The president is right to be concerned about serious violence. He should be concerned about the serious violence in his own country, which is more than 10 times higher than it is in the UK.”

Michael Gove mildly criticised Trump, saying: “I think it always a mistake to retweet anything that Katie Hopkins tweets.”

Rory Stewart, the international development secretary and another leadership hopeful, also declined to criticise Trump, saying such actions should take place in private. “You should be firm, you should talk about your national interests, you should talk about it politely, you should talk about it very clearly and you should do it privately,” he said.

Stewart later changed his stance, tweeting: “I 100% disagree with both the language and the sentiment of the last sentence of this tweet. Can all candidates please confirm the same.”

A man was stabbed to death in Wandsworth, south-west London, shortly before 4.45pm on Friday, and another man was shot dead in Greenwich, in the south-east of the city, at about 5pm on the same day. On Saturday afternoon a man in his 30s was stabbed to death in Tower Hamlets, east London.