A man accused of carrying out the Finsbury Park attack "decided to take matters into his own hands" after growing angry at a rise in terrorism and the Rotherham child exploitation scandal, a court has heard.
Darren Osborne, 48, allegedly mowed down Makram Ali, 51, and nine other people on a crowded pavement with a heavy Luton box van near two mosques in north London shortly after 12.15am on June 19 last year.
The area was busy with worshippers attending Ramadan night prayers at the time, the jury at Woolwich Crown Court was told.
Opening the trial on Monday, prosecutor Jonathan Rees QC told the court: "The prosecution say that the evidence establishes that the defendant was trying to kill as many of the group as possible.
"In the event, he killed one person, a 51-year-old man called Makram Ali, and in addition he injured many others, some of them seriously."
He added: "To seek to kill someone merely because of their religion is a terrible thing.
"And what makes this act particularly horrific is that the group he drove into had gathered in the street in order to help Makram Ali, the deceased, who had collapsed as he walked along Seven Sisters Road a couple of minutes before the defendant carried out his attack."
Osborne, of Glyn Rhosyn, in Cardiff, is charged with the murder of Mr Ali and attempted murder of "persons at the junction of Seven Sisters Road and Whadcoat Street, London", which he denies.
The defendant had driven from Cardiff to London the previous day originally intending to drive the van into people taking part in the Al Quds Day march, but began looking for another target when this did not prove viable, the court heard.
A handwritten note was found in the cab of the van within hours of the attack, which complained about terrorists on the streets and the Rotherham child exploitation scandal, Mr Rees said.
The note, which branded Labour Leader Jeremy Corbyn a "terrorist sympathiser" and attacked London Mayor Sadiq Khan, included the comments: "This is happening up and down our green and pleasant land.
"Filthy, inbred, raping Muslim men, hunting in packs, preying on our children."
It added: "Get back to the desert you raping, inbred bastards and climb back onto your camels."
Mr Rees told the jury: "The underlying theme seems to be that the defendant felt that insufficient was being said or done to counter terrorism and the grooming gangs comprising predominantly Muslim males.
"Against that background, the defendant decided to take matters into his own hands. He planned to make a public statement by killing Muslims, knowing that his handwritten note would be recovered by the authorities."
He added: "Although there is no terrorist offence for you to consider in this case, the prosecution say that the note and the comments he made after his detention establish that this act of extreme violence was, indeed, an act of terrorism.
"That was the motivation behind it, designed to influence government and intimidate the Muslim community, and done for the purpose of advancing a political, religious, ideological or racial cause."