Mohiussunnath Chowdhury, 27, allegedly drove at police outside Buckingham Palace and then attacked them with a samurai sword because Queen Elizabeth II is an “enemy of Allah”, the Old Bailey has heard.

The court heard that on August 25th, 2017, at 8:30 pm the Luton resident swerved at a moving police van outside of Buckingham Palace, causing the police to stop and the two officers to get out and investigate.

Taking the four-foot sword from the footwell, the defendant is alleged to have shouted “Allah hu Akbar” (“My god is greater [than yours]”) during the struggle with the officers before being subdued and arrested, the Evening Standard reports.

The jury heard that Detective Sergeant Gavin Hutt and Police Constable Ian Midgley had suffered cuts as they disarmed Chowdhury with CS gas.

Prosecutor Timothy Cray QC told the court that Chowdhury’s sister had found his suicide note earlier in the day, allegedly outlining his reasons for the attempted terror attack, which said: “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 Bangladeshi-heritage Uber driver then changed his Facebook profile picture to a green bird – signalling he was to become a martyr.

The prosecutor told the jury that Chowdhury had self-radicalised, and had searched the internet for Islamic State beheading videos and for the beheadings committed by the British terrorist ‘Jihadi John’.

Mr. Cray also told the court that he had said on WhatsApp: “I support ISIS [Islamic State].”

In another WhatsApp chat related to Westminster Islamist terrorist Khalid Masood – who had killed four civilians and PC Keith Palmer who was on guard outside the Houses of Parliament just months before in a vehicular and knife attack – he also wrote: “Fuck the police.”

“He had expressed hatred to the Queen and her soldiers, which in his mind her soldiers included the police,” Mr Cray alleged.

The jury also heard that the Uber driver may have intended to stage an attack outside of Windsor Castle earlier on in the evening, but his satnav took him to the Windsor Castle pub in Victoria, Westminster.

The prosecutor told the jury that during questioning after the arrest, Chowdhury gave a full account of his intention to attack police.

“Putting it bluntly there is no doubt in those interviews he was confessing that he had planned to confront the police and that he saw them as people who did the ‘dirty work’ of the UK government,” Mr Cray said.

However, Chowdhury denies preparing acts of terrorism, claiming he only wanted to get himself killed. The trial continues.