LONDON — An Uber driver who allegedly tried to attack police with a Samurai sword outside Buckingham Palace has told a court he became angry after seeing news put out by the Russian television network RT.

Mohiussunnath Chowdhury, 27, from Luton, said he was looking at news produced by the controversial English-language channel on his phone on the day he decided to "confront" police outside Windsor Castle, 40 miles south of Luton.

He told the Old Bailey — the Central Criminal Court of England and Wales — that he felt guilty because he believed Britain was committing war crimes by supplying weapons to Saudi Arabia, which is using the weapons in Yemen.

"Because I'm paying tax and these guys represent us. The decisions they make are on our behalf," he added.

Chowdhury denied that he had driven to a pub in Windsor instead of the castle because he put the wrong address in his GPS.

He claimed he had put the street address of the pub into the device because it was close to the actual castle where he had first planned to die at the hands of police as a protest.

"The reason I chose it is obviously the royal family, the Queen lives there and I assumed there would be a whole bunch of guys with guns outside it," he said.

But when he arrived he could not find any armed guards so he drove on to Buckingham Palace in London, 25 miles to the east. At Buckingham Palace, he swerved in front of a police van. He brandished his four-foot sword at officers, who then disarmed him during a violent struggle.

Chowdhury had told a friend via the messaging service WhatsApp "I support ISIS" and changed his display picture to the black flag used by the terrorist group.

But he claimed he had considered participating in charity or aid work when he first started seeing news about the war in Yemen at the end of June or early July last year, before deciding it was pointless.

On the morning of Aug. 25, 2017, he woke up sometime after midday after doing a night shift and checked his phone.

"Basically I opened the news up, I think on RT, and I saw that more bombs had been dropped and what struck me was that this bomb had been dropped on a wedding and there was a 'double tap' and they threw a bomb and then another so that there were no survivors."

He said he remembered thinking: "If they can kill these people then they can kill me as well. I know the British government is involved in this war and the weapons are ours.

"These people are innocent people why are they getting killed? It doesn't make any sense. I feel like I am complicit in it as well.

"I just thought I wanted to die at that point and I thought I should do something."

Mohiussunnath Chowdhury shopping for a knife sharpener in Sainsbury's on the day of the attack in August 2017.

His plan, he said, was to "die at the hands of the authorities and the best way was to show them a weapon and it would be just like in America where they would shoot them on sight and don't ask any questions."

Chowdhury said it "wasn't about furthering any political or religious cause or intimidating people," adding, "It was like I want to die just like they die in Yemen to clear my guilty conscience."

He explained that committing suicide is forbidden in Islam because it was the "same as killing an innocent person."

"It's not something I can do," he added. "I had to get that out of my mind."

Chowdhury told his sister he intended to die during a phone call as he drove to London.

Giving evidence in his defense, Chowdhury described a phone call to his sister in which he told her: "I'm going to die, by the end of the day, I'm going to be dead."

Chowdhury claimed he also added: "I'm not going to do anything bad, I'm not going to harm anyone, I'm just going to face these soldiers and get killed."

The Samurai sword used by Mohiussunnath Chowdhury in the attack outside Buckingham Palace in London.

"There was a lot of crying in the phone call as well. Obviously she was saying, 'Don't do this, come back,'" Chowdhury said.

But he threw his phone sim card and battery out of the car window so that she could not ring back, he said.

That morning, Chowdhury said, he assumed he was going to be dead by day's end and decided to visit his sister at the Sainsbury store where she worked before writing her a "goodbye letter."

Chowdhury admitted that he had written a "very emotional and angry" letter to his sister that he posted on her computer.

In the letter, he called his sister "Shrimp" and told her, "I love you most in the world," adding, "By the time you read this Insha'Allah [god willing] I will be with Allah. Do not cry and be strong.

"The shaheed [martyr] will take 70 members of his family with him to paradise. I will take you there Insha'Allah."

He also told her, "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."

As he grappled with the officers outside Buckingham Palace, Chowdhury shouted "Allahu Akbar" [god is great]."

In court, he explained, "I thought, 'I'm going to get killed.' The last words I wanted to say were the words of God."

Asked if he still felt suicidal, he told the court: "I started to pray more and go to Islamic classes and I felt better."

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.