Uber driver Mohiussunnath Chowdhury denies preparing acts of terrorism, saying he only wanted to get killed when he crashed his car outside Buckingham Palace, sparking a struggle with police.
Chowdhury, 27, from Luton, had repeatedly shouted “Allahu Akbar (God is greatest)” as officers tried to stop him from using the 42in blade.
The Old Bailey heard that Chowdhury had intended to go to Windsor Castle on 25 August but a satnav error had sent him to the Windsor Castle pub instead.
He drove on to Buckingham Palace but attracted the attention of a police van after running over some traffic cones.
When acting Sergeant Gavin Hutt approached the car, Chowdhury allegedly said: “It’s all a bit f***** up”, before reaching for his sword.
Mr Hutt said: “I started punching him in the face just trying to pull his arm away as well. My instinct was to try and render him unconscious.”
While that was happening, PC Ian Midgley grabbed the sword from the passenger side of Chowdhury’s Toyota Prius and was punched in the head.
Both officers suffered cuts to their hands and had feared for their lives, the court was told.
But they eventually managed to arrest Chowdhury.
Prosecuting lawyer Tim Cray said Chowdhury had been part of a “close and supportive family” before being radicalised online.
On WhatsApp, he is alleged to have said “F*** the police” when discussing the Westminster attack six months earlier, also sending emojis of a British soldier in a red tunic and bearskin hat along with a knife and an “Arabic figure”.
Jurors heard that Chowdhury had left his sister a suicide note before setting out for the castle and then the palace.
He had allegedly written: “Tell everyone that I love them and that they should struggle against the enemies of Allah with their lives and their property.
“The Queen and her soldiers will all be in the hellfire they go to war with Muslims around the world and kill them without any mercy.
“They are the enemies that Allah tells us to fight.”
The trial continues.