London mayor Sadiq Khan paid tribute to police and emergency services March 22 following an attack in the British capital that left four people dead and dozens wounded. (Reuters)

LONDON — Donald Trump Jr. took a break on Wednesday from defending his father's agenda on Twitter to weigh in on the attack outside the British Parliament that left four people dead, including a police officer and the alleged assailant.

The president's oldest child took aim at Sadiq Khan, the mayor of London, who was quoted last year by the Independent, a London newspaper, as saying terrorism preparedness had to become part of the fabric of major cities. That message took on new meaning Wednesday as an attacker drove his car through pedestrians on Westminster Bridge and then fatally stabbed an officer at the gates of Parliament.

“London mayor says terror attacks 'part and parcel' of living in a major city,” the Independent's headline breathlessly announced. In fact, Khan was talking about preparedness, as his full quote made clear: “Part and parcel of living in a great global city is you’ve got to be prepared for these things. You’ve got to be vigilant. You’ve got to support the police doing an incredibly hard job.”

Nevertheless, scarcely two hours after first reports of Wednesday's attack emerged, the American president's son pounced.

Khan, who last year became London's first ethnic-minority mayor and the first Muslim to head the capital of a major Western country, issued a statement Wednesday offering his condolences to the families of victims, paying special homage to the fallen police officer.

“I want to reassure all Londoners and all our visitors not to be alarmed — our city remains one of the safest in the world,” said Khan in a statement. “Londoners will never be cowed by terrorism.” He otherwise kept a low profile as Parliament went on lockdown and police cordoned off a broad perimeter that surrounded iconic sites such as Big Ben, the London Eye and Westminster Abbey.

That move incensed some users on Twitter, who joined Trump in condemning the mayor. But many also rushed to his defense, including Wes Streeting, a member of Parliament from the Labour Party, who replied directly to Trump and called him a “disgrace.”

Three people were killed by an assailant in a car and knife attack near Britain's Parliament. The attacker was later shot and killed by police. (Jason Aldag,Victoria Walker/The Washington Post)

British lawmakers emerging from Westminster Abbey, where they found sanctuary after the attack, also defended the mayor — and insisted his Muslim identity would not be a factor as the city comes to grips with the incident.

“There should not be a single thought about what his identity is,” said Pola Uddin, a member of the House of Lords. “This is a moment of reflection for all Londoners, and should lead us to consider the fact that we largely haven't experienced such attacks before, while other cities have.”

Dominic Grieve, a Conservative MP, said the mayor was not in a difficult position owing to prior statements on terrorism and security — “none whatsoever,” he said.

The message the mayor has sent to London residents is fitting, said Digby Jones. “You're safer in London than you've ever been,” he said. “If this turns out to be an act of Islamic terrorism, I think the fact that the man is a Muslim is utterly and completely irrelevant.”