Two men accused of murdering the soldier Lee Rigby believed they were acting as "soldiers of Islam" in a strike against British foreign policy, the Old Bailey in London has heard.

Jurors were told on Wednesday that Michael Adebowale agreed with his co-accused, Michael Adebolajo, that they killed the 25-year-old Rigby because it was an order from Allah.

Hearing the defence of Adebowale for the first time, jurors were told how the 22-year-old pointed an unloaded pistol at armed police so that he would be shot in a "last-ditch attempt at martyrdom".

Adebowale and Adebolajo, 28, have pleaded not guilty to murdering Rigby and the attempted murder of police officers outside Woolwich military barracks on 22 May. The jury will retire to consider their verdicts on Thursday morning.

Abbas Lakha QC, for Adebowale, described the death of the soldier as a "shocking event" that was meant to "shock a nation into waking up to what was happening in Muslim lands".

He told the jury that the two accused were acting "as soldiers of Islam – this was a military operation they planned together and their target in that operation was a British soldier, and only a British soldier, no one else".

Adebowale, who chose not to give evidence in his defence, sat by Adebolajo in the court dock during Lakha's closing speech. Adebolajo has asked to be known as Mujahid Abu Hamza in court, and Adebowale has asked to be called Ismail Ibn Abdullah.

Lakha said: "On behalf of the second defendant [Adebowale], I did not challenge Mr Abu Hamza's evidence.

"What that means is Ismail agrees with what Mr Abu Hamza said about the reasons for the killing of Lee Rigby and they were acting together in that way and for those reasons. That is his case."

Jurors were shown video footage of the moment Adebolajo and Adebowale charged in the direction of the first marked police car that arrived at the scene.

Adebolajo, holding a butcher's knife and a meat cleaver, charged directly at the armed officers while Adebowale, holding an unloaded 90-year-old pistol, ran alongside a wall a few feet away.

Adebolajo was the first to be shot by officers, sending him spinning to the ground and causing him to drop the knives.

Officers then opened fire on Adebowale as the suspect, still in motion, pointed the pistol in their direction. Adebowale crumpled to the ground after sustaining a gunshot wound. While on the floor he appeared to lift his hand, holding the pistol in the direction of officers before being shot in the hand.

"He lifts his hand and despite knowing the officers are fully armed and he has one unloaded weapon in his hand he raises it and points it at the police. You know the result of that: the officers shot him again," said .

"Why would a man do that knowing, as he must have, that the weapon in his hand could not hurt anyone unless it was a last-ditch attempt at martyrdom?"

Earlier Lakha told jurors they must put aside any emotion or prejudices and try Adebowale only on the evidence they had heard.

"The fact he has not given evidence doesn't mean he says nothing in this trial," he said. "He uttered the two most important words any man in any court in this land can utter – he said the words 'not guilty'."

The judge, Mr Justice Sweeney, told the jury that they must show "cool, calm, careful and dispassionate" consideration of the evidence when they retire to consider their verdicts. The trial continues.