Michael Adebolajo, 29, and Michael Adebowale, 22, appeared in the dock at the Old Bailey on Wednesday to hear their fates, having been convicted of Fusilier Lee Rigby's murder.
He was hacked to death in front of horrified passers-by near his base in Woolwich last May.
Adebolajo, who tried to behead the soldier, was given the whole life term. Adebowale, who stabbed him in the chest, was jailed for life with a minimum tariff of 45 years.
But Mr Justice Sweeney eventually had to sentence the two men in their absence, after they began to shout in protest until they were overpowered by security guards and taken back to the cells.
They had previously claimed that they killed Fusilier Rigby because they were "soldiers of Allah" motivated by the plight of Muslims.
During sentencing, which had been delayed to allow for a key appeal court ruling on whether "whole life" terms could be used, they reacted violently when the judge said they had been radicalised.
You each converted to Islam some years ago. Thereafter you were radicalised and each became an extremist, espousing views which - as has been said elsewhere - are a betrayal of Islam.
Mr Justice Sweeney
"Your sickening and pitiless conduct was in stark contrast to the compassion and bravery shown by the various women at the scene who tended to Lee Rigby's body and challenged what you had done and said," Mr Justice Sweeney said.
Adebolajo's whole life sentence means that he will never be considered for parole.
"In your case, Adebolajo, there is no mitigation," the judge said.
"And whilst to state the obvious, this is not a case of mass or repeated murder, it is nevertheless one of those rare cases where not only is the seriousness exceptionally high, but the requirements of just punishment and retribution make such an order the just penalty.
"Accordingly, in your case, I propose to impose a whole life term."
The judge explained that Adebowale's lesser term was due to his particular role and circumstances.
"In your case, Adebowale, I am persuaded that the combination of your lesser role, your age and your pre-existing and continuing mental condition mean that it is not appropriate in your case to impose a whole life term," Mr Justice Sweeney said.
"Nevertheless, in your case, there must still be a very substantial minimum term. The term that I propose to impose is one of 45 years, less 272 days spent on remand."
Earlier, in response to the judge's comments that the pair had been radicalised, Adebolajo began to scream "allahu akbar" while Adebowale protested that claims they had betrayed Islam were "a lie".
Both men hurled abuse at the security guards who struggled to control them, as Lee Rigby's family wept in distress in the public gallery.
One relative required medical treatment as a result of the ordeal, before the judge continued with the sentencing.
Outside the Old Bailey, dozens of far-right protestors gathered - including British National Party and English Defence League supporters.
According to City of London Police, a man was arrested on suspicion of actual bodily harm, a second man was held over affray and a woman was arrested on suspicion of being drunk and disorderly.
Some protestors erected gallows in the street and held up placards stating: "Restore capital punishment", before cheering when the sentences were announced.
We would like to thank the judge and the courts for handing down what we believe to be the right prison terms ... We feel satisfied that justice has been served for Lee.
Lee Rigby's family
Head of Scotland Yard's counter-terrorism command, Assistant Commissioner Cressida Dick, said that the jail terms reflected "the true horror of their actions in taking this young man's life in such a barbaric way".
Sue Hemming, head of special crime and counter terrorism at the Crown Prosecution Service, added that the soldier's family had found the whole court process distressing.
"Michael Adebolajo and Michael Adebowale revelled in one of the most appalling terrorist murders I have seen whilst head of counter terrorism at the CPS," she said.
"Not only was the attack brutal and calculated, it was also designed to advance extremist views.
"As a soldier, Fusilier Lee Rigby was targeted in a clear act of revenge, deliberately carried out in full view of members of the public for maximum impact."
Ms Hemming further stated that the attack did not have the effect it was designed to, as the public were united in their shock and grief at what had happened in broad daylight and in front of cameras.