When he was searched, police found two 10cm (4ins)-long blades and a handwritten copy of a verse titled “the benefit of martyrdom”.

His trial heard how he told police: “I want to make a crime inside there. Why are you stopping me? Why are you stopping me from making crimes?”

During a later interview at a police station, he said he had wanted “to do something to stop the war”.

The Old Bailey also heard evidence he may have acted in a way to force the nearby armed officers to kill him.

Prosecutor Catherine Pattison said Albadri “intended to do something that would have resulted in the sacrifice of his life”.

She told the court people were leaving the embassy when he attempted to scale the fence who “would not have had any chance to defend themselves” if he had been able to carry out the attack.

Defence barrister Chris Henley said Albadri’s plan “could never ever have succeeded”, adding “there was no serious risk of any harm to anybody”.

He said Albadri had acted in an “absurd, performative fashion” which was “deliberately designed to draw attention to himself”.

Albadri had spent the morning “trying to get help” to access housing, his defence barrister told the court.

His trial previously heard he told officers “I wish you’d use that on me”, and replied “I might be yeah” when asked if he was referring to a rifle.

On Monday, Mrs Justice Lambert KC sentenced Albadri to life in prison with a minimum term of 20 years.

Commander Helen Flanagan, head of Counter Terrorism Policing (CTP) London, said: “Albadri’s attempt to carry out a terrorist attack at the embassy was thwarted due to the courageous and swift actions of officers on duty, who prevented him from breaching the security perimeter.

“The significant prison sentence he has received reflects the danger he posed on the day and the lack of remorse he has shown since he was arrested.”

She said the Israeli embassy had “face various security alerts in recent times” and security measures were in place to “ensure the site and the wider community is kept as safe as possible”.