DETROIT — The Nigerian man who tried to blow up a Detroit-bound airliner with explosives concealed in his underwear on Christmas Day in 2009 was sentenced Thursday to life in prison by a federal judge who said his crime and subsequent lack of remorse demanded the maximum possible punishment.

The man, Umar Farouk Abdulmutallab, who pleaded guilty in October and admitted to working on behalf of Al Qaeda, shouted, “Allahu akbar,” or “God is great,” five times during the sentencing hearing. He asserted that Muslims were “proud to kill in the name of God, and that is what God told us to do in the Koran.”

Five people on the flight, including a flight attendant who helped put out a midair fire that Mr. Abdulmutallab started with his explosives, spoke during the hearing about the nightmares and fear they had experienced since the episode.

Judge Nancy G. Edmunds of Federal District Court ordered Mr. Abdulmutallab to serve the maximum sentence of four consecutive life sentences, plus an additional 50 years, on the charges, which included conspiracy to commit an act of terrorism and attempted use of a weapon of mass destruction. Judge Edmunds denied a motion by Mr. Abdulmutallab, who represented himself during much of the case, with the assistance of a standby lawyer, to declare life imprisonment as cruel and unusual punishment because his act did not kill or seriously injure anyone.