NEW YORK - Ahmed Khalfan Ghailani, the first former detainee at US Guantanamo Bay prison, will be incarcerated for life for his part in horrific attacks on two US embassies in Africa, a judge ruled Tuesday in New York. Before giving the 36-year-old militant life in prison without chance for parole, US District Judge Lewis Kaplan said Ghailani knew and intended that people would be killed in the 1998 bombings of the embassies in Kenya and Tanzania. A total of 224 people, including a dozen Americans, died and thousands were hurt in the attacks. The very purpose of the crime was to create terror by causing death and destruction, the judge said. US Attorney General Eric Holder expressed satisfaction with the sentence, which was far stiffer than the minimum 20 years Ghailani could have received. Todays sentencing of Ahmed Ghailani shows yet again the strength of the American justice system in holding terrorists accountable for their actions, Holder said in a statement. Ghailani will now rightly serve the rest of his life in prison ... . Ghailani, who was apprehended in Pakistan in 2004, was convicted by a federal jury in November on a single conspiracy count to destroy buildings and property. He was acquitted on 284 other counts. He is the fifth defendant convicted in the case. Finally, 12 1/2 years after those devastating and despicable attacks, Ahmed Ghailani will pay for his crimes, CNN quoted US Attorney Preet Bharara as telling reporters.