LONDON — An al-Qaeda-inspired extremist was sentenced to life without parole Wednesday for hacking an off-duty British soldier to death on a London street in front of horrified passers-by.

Images of Michael Adebolajo, 29, holding a butcher knife and cleaver with bloodied hands in the moments after the May 22 killing of Fusilier Lee Rigby shocked people around the world and sparked fears of Islamist terrorism in Britain.

The self-described “soldier of Allah” was sentenced at Central Criminal Court along with his accomplice, 22-year-old Michael Adebowale, who was sentenced to life with a minimum of 45 years in jail because of his age and lesser role in the murder.

The day ended in drama when both men were pinned to the ground and led out of the courtroom after scuffling with guards and shouting at the judge moments before their sentences were read out.

Adebolajo yelled “Allahu akbar” — “God is great” — while Adebowale called out “that’s a lie” as the judge told them they had been radicalized.

Outside the court, protesters from two far-right groups erected gallows and demanded capital punishment for the two men.

The pair was convicted in December of murdering Rigby, 25, who was walking near his barracks in south London when the men ran him over with a car. They then dragged his body onto the road, and repeatedly stabbed him with knives. Adebowale attacked his torso, while Adebolajo attempted to cut off the soldier’s head with a cleaver.

Moments after the killing, Adebolajo was filmed by onlookers delivering a rambling monologue justifying the attack as he held the bloodied weapons.

This undated image released Thursday, May 23, 2013, by the British Ministry of Defence, shows Lee Rigby, who was identified by the MOD as the serving member of the armed forces who was attacked and killed by two men in the Woolwich area of London on Wednesday (photo credit: AP/MOD)

This undated image released Thursday, May 23, 2013, by the British Ministry of Defence, shows Lee Rigby, who was identified by the MOD as the serving member of the armed forces who was attacked and killed by two men in the Woolwich area of London on Wednesday (photo credit: AP/MOD)

Rigby was killed because “Muslims are dying daily by British soldiers” — “an eye for an eye, and a tooth for a tooth,” he said in the video, which was broadcast around the world.

In his testimony, Adebolajo told the court that he loved al-Qaeda — though he never met its members. He also said he and Adebowale had decided to kill a British soldier and Rigby was the first they came across.

Judge Nigel Sweeney said their actions were “sickening and pitiless” and resulted in a “bloodbath.” He added that he was certain Adebolajo had no hope of rehabilitation.

“You decided, between you, and in order to advance your extremist cause, to murder a soldier in public in broad daylight and to do so in a way that would generate maximum media coverage,” he said. “You both gloried in what you had done.”

Rigby’s family said after the sentencing that they were satisfied justice has been served.

Copyright 2014 The Associated Press.