An ISIS-supporting Uber driver who 'hated the Queen' tried to run down police officers outside Buckingham Palace and attack them using a Samurai sword, a court has heard.

Mohiussunnath Chowdhury left a note for his sister in which he promised he would see her in paradise and told her 'the Queen and her soldiers will all be in the hellfire,' the Old Bailey heard.

The 27-year-old from Luton had written on one Whatsapp chat, 'I support ISIS' and searched for ISIS beheading videos online, the court heard.

Chowdhury had also planned to go to Windsor Castle but went to a pub with the same name by mistake, due to a 'satnav error', prosecutors claimed.

Mohiussunnath Chowdhury, 27, from Luton, (pictured here in an earlier court sketch), denies preparing terrorist acts

Timothy Cray prosecuting said: 'The day of the events in London, the defendant went to somewhere else connected to the royal family.

'It may have been through some satnav error, he drove past Windsor Castle but stopped for some time at a pub called The Windsor Castle.

'He also drove past the barracks where the Coldstream Guards are based.

'He didn't do anything in Windsor, he made a bit of a tour and in the end went back up the M4 to central London.'

Shortly before 8.30pm on August 25 last year, Chowdhury was driving towards the Victoria Monument at the bottom of the Mall when he swerved his car through the traffic cones in front of a police van on its way to Belgravia from Charing Cross Police Station.

Two uniformed officers in the car, got out of the van to see what was going on, initially believing the driver might be drunk, the court was told.

Prosecutor Tim Cray told the Old Bailey: 'As checks were to prove, this defendant had something far more serious in his mind.'

At 5.15pm he had left a note on top of his sister's laptop at the family home in Luton, while she was at work.

Marked, 'Read This' it said: 'By the time you read this note I will be in paradise with Allah. Tell everyone that I love them and that they should struggle against the enemies of Allah with their lives and 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 mercy. They are the enemies that Allah tells us to fight.'

Mr Cray said Chowdhury was 'saying to her in clear terms that he intended to get to paradise by becoming a martyr.'

Half an hour earlier, Chowdhury had driven to his local Sainsbury's and bought a sharpening tool which he used to sharpen the edge of a sword that he owned.

Prosecutor Timothy Cray showed the Old Bailey jury the samurai sword allegedly recovered from Chodhury near Buckingham Palace

'Although the police officers did not know it they were approaching a man armed with as sword, who had told his family he was gong to be a martyr and had express hatred to the Queen and her soldier and in his mind those soldiers included the police,' Mr Cray said.

'It was due to the bravery and quick reactions of the police that this defendant was stopped from doing an act with even more serious consequences.'

One officer went to the driver's side and one to the passenger's side and they allegedly heard Chowdhury say: 'It's all a bit f****d up,' before reaching for the sword.

There was a 'short desperate struggle' in the car as one officer climbed in the passenger side and Chowdhury was punching at them and they were punching at him, the court heard.

'By then the defendant was shouting Allahuakbar [God is great] over and over again and by then the police officers understand enough to believe they were dealing with a terrorist attack.'

The attack came just six months after a murder at Westminster and just three months after the attacks at London Bridge, Mr Cray added.

'Here again we had the centre of London prominent location, possibly the most prominent, driving erratically and attacking officers.'

Using CS gas the officers manage to get the weapon from Chowdhury and one suffered a cut across his hand and the other a cut on his finger.

But the Uber driver had earlier driven to the Windsor Castle pub after apparently entering the wrong details in his sat nav, the court heard.

Mr Cray said: 'It may be due to some sort of sat nav error, that, although he drove past Windsor Castle, he came to a pub called the Windsor Castle.

'He drove past the barracks of the Coldstream Guards, he didn't stop, he made a bit of a tour of Windsor and then headed back down the M4 to London.'

After he was arrested, Chowdhury was interviewed by police and gave a 'reasonably full' account of what he had done and what he was trying to do.

'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.

Chowdhury claims 'all he wanted to do was to get himself killed.'

'On behalf of the Crown we suggest that is simply untrue or so far from the truth that it makes no difference,' Mr Cray said.

'We say the defendant did absolutely everything he could to prepare for an act of terrorism.

'In fact there is the clearest possible evidence that he did bring terror to streets of London by attacking police officers right in front of Buckingham Palace.

'We say it is only because police officers stopped him that nothing worse happened.'

Chowdhury denies preparing terrorist acts by obtaining a Samurai sword, purchasing a knife sharpener, preparing a suicide note, and driving to the area adjacent to Buckingham Palace.

The trial continues.