A man staged a terrorist attack in Parliament Square, turning a car into a weapon aiming to kill as many civilians and police as possible in a “premeditated and deliberate attack”, a jury has heard.

Salih Khater, 30, was charged with attempted murder and attempted grievous bodily harm of civilians and police officers after the incident in central London on 14 August 2018.

The jury at the Old Bailey saw CCTV footage of the silver Ford Fiesta that Khater is alleged to have used, hitting cyclists before moving on to a slip road and heading towards police officers at speed.

Opening the case, Alison Morgan QC told the jury: “First, he drove at cyclists waiting at traffic lights. Then he drove at police officers who were guarding the side entrance to the Palace of Westminster. His actions were not a mistake or as a result of some kind mechanical error to his vehicle.

“They were deliberate and designed to cause maximum death and injury. He caused widespread fear and chaos, but miraculously, and contrary to his intentions, he did not kill anyone. Those who were faced with a vehicle being driven at them at high velocity somehow, and largely as a result of their quick reactions, managed to avoid death or very serious injury.”

Morgan said the jury were entitled to conclude that the motive was terrorism: “Precisely why he wanted to kill people who he did not know is not clear. But you may think that by targeting Parliament Square, by targeting people that he did not know, and ultimately by attacking police officers guarding the Palace of Westminster, the defendant had a terrorist motive.

“That is to say that he intended to use serious violence to pursue a religious, political or ideological cause. The prosecution allege that this is the obvious inference from what he did, where he did it and how he did it. But in fact the charges that you have to consider do not require you to determine that issue.”

Khater, who was living in Birmingham at the time, is originally from Darfur in Sudan. Morgan said his mood had worsened in the months before the incident and he had failed exams in accountancy at Coventry University.

Khater was showing signs of paranoia about the actions of the UK authorities and he sent an email in May 2018 to Jeremy Corbyn, the Labour leader, complaining about his treatment, the jury heard. Morgan said: “The response from a Labour party representative was understandably vague.”

He drove to London during the night and then drove around the Parliament Square area to familiarise himself with it, Morgan alleged. Immediately before driving his car at people, he “conducted four laps” around parliament, having waited for the area to grow busy, the jury heard.

Khater first hit cyclists, Morgan said, before driving at 32mph at PC Darren Shotton and PC Simon Short.

Morgan told the jury: “The defendant embarked on a calculated and targeted attack in which he intended to kill vulnerable members of the public and police officers, in each case using his car as a lethal weapon to knock them down at accelerating speed.

“The defendant selected an iconic site. This was no coincidence. It is a location of national importance, one that had been subjected to terrorist attacks in very recent history.”

The jury was told that Khater was arrested by armed police and during questioning offered no explanation for what he had done.

Khater denies the charges and the trial continues.