The reaction in Britain was weary humor and bewilderment, with many in the news and on social media questioning where the president got his information.
The writer and performer Robert Webb wrote on Twitter: “Well, it’s a beautiful day here in Trump’s war zone. I’ve been to the shop and didn’t get even mildly stabbed.”
According to the BBC, Mr. Trump may have used as inspiration a Radio 4 interview last month with a London trauma surgeon, Dr. Martin P. Griffiths, who said he was treating stabbing victims “on a daily basis.”
He added that some of his military colleagues had described their practice at the institution as similar to that of a military camp in Afghanistan. The interview was picked up by Mail Online.
But the surgeon, who works for the Royal London Hospital, responded on Twitter to Mr. Trump, suggesting he had missed the whole point and saying he was “happy to invite Mr. Trump to my (prestigious) hospital.”
Karim Brohi, a trauma surgeon at the Royal London Hospital and director of London’s major trauma system, said in a statement on Saturday that while knife violence was “a serious issue” in London, “to suggest guns are part of the solution is ridiculous.”
He added: “Gunshot wounds are at least twice as lethal as knife injuries and more difficult to repair. We are proud of our world-leading service and to serve the people of London.”
Knife crime in Britain rose by 21 percent last year, according to figures released in September by the Office for National Statistics, which compiles an authoritative survey of crime in England and Wales.
Stabbings in London were at their highest level in six years: At least 38 people in London have died from knife crime so far this year, according to the Metropolitan Police.
More than 30,000 Americans were killed by firearms in 2016, according to statistics from the Centers for Disease Control and Protection.
In France, after Mr. Trump said a civilian could have stopped the massacre at the Bataclan concert hall in November 2015 if that person had been armed with a gun, François Hollande, the former French president, said on Twitter that the comments and antics were “shameful” and “obscene,” according to Reuters.
The mayor of Paris, Anne Hidalgo, also said that Mr. Trump’s portrayal of the attacks was “contemptuous and unworthy.”
The American president previously suggested that schoolteachers should get a “bit of a bonus” to carry guns — a position backed by the N.R.A. But in February, under pressure after a gunman killed 17 people at a school in Florida, he ordered the Justice Department to consider banning so-called bump stocks, which allow semiautomatic guns to fire at nearly the rate of a machine gun.
Mr. Trump’s latest remarks came weeks after he accepted Prime Minister Theresa May’s invitation to come to Britain, after canceling an earlier plan to visit.
The mayor of London, Sadiq Khan — who previously faced criticism by Mr. Trump and Donald Trump Jr. over his handling of terrorist attacks in the city — had warned that the president could face protests if he visited the capital on July 13.