Ali Harbi Ali is on trial accused of murdering Sir David Amess MP at a constituency surgery.
The death of MP Sir David Amess was an assassination by a “committed, fanatical, radicalised Islamist terrorist”, a court heard.
Sir David, MP for Southend West, was stabbed during a constituency surgery in Leigh-on-Sea, Essex, on 15 October.
Ali Harbi Ali had carried out reconnaissance of potential targets over several years, including cabinet minister Michael Gove, the jury heard.
The 26-year-old denies murder and preparing acts of terrorism.
Opening the trial at the Old Bailey in London, prosecutor Tom Little QC described the defendant as a “radicalised Islamist terrorist” and called it a “murder carried out because of a warped and twisted and violent ideology”.
“This was nothing less than an assassination for terrorist purposes,” he said.
“It is a crime to which, we say, he has no defence.”
The court heard Mr Ali had requested an appointment with Sir David under the pretence he was moving to the area and he provided a postcode to verify this.
Mr Little told jurors that Mr Ali appeared “relaxed and chatty” as he walked over to Sir David just before he “brutally” stabbed him in a “vicious and frenzied attack” shortly after midday on 15 October.
The prosecutor added: “This is a case involving a cold and calculated murder, a murder carried out in a place of worship.
“It was a murder carried out by that young man [Mr Ali] who for many years had been planning just such an attack and who was, and is, a committed, fanatical, radicalised Islamist terrorist.”
Sir David, first elected as a Conservative MP in Basildon in Essex in 1983, was pronounced dead at the scene, where Mr Ali was arrested by police.
Mr Little said the attack was “no spur-of-the-moment decision”, and said Mr Ali bought the knife used to attack Sir David five years earlier.
He said: “He had for a number of years been determined to carry out an act of domestic terrorism.”
Mr Little said the defendant had carried out reconnaissance prior to the attack including scoping out locations of targets to attack, namely the Houses of Parliament and addresses associated with MPs including Michael Gove, the Secretary of State for Communities and Levelling Up and MP for Surrey Heath.
Reconnaissance trips to a constituency surgery of the Conservative MP for Finchley and Golders Green Mike Freer had also been carried out by Mr Ali, the court heard.
The preparing acts of terrorism charge relates to activity alleged to have been carried out between 1 May 2019 and 28 September 2021.
Mr Ali, of Kentish Town, north London, appeared in the dock wearing a black robe and black-rimmed glasses.
The trial continues.
Find BBC News: East of England on Facebook, Instagram and Twitter. If you have a story suggestion email eastofenglandnews@bbc.co.uk