An Egyptian lawyer was sentenced Friday to 25 years behind bars for conspiring with Osama bin Laden in the 1998 bombings of two US embassies in Africa that left 224 people dead — including 12 Americans.

While imposing a maximum sentence, Manhattan federal Judge Lewis Kaplan pointed out that Adel Abdel Bary, 54, benefitted from an “enormously generous plea bargain” that should have him out of jail in eight years when factoring in 17 years of time already served.

“Unlike the victims of the embassy bombings, you can look forward to rejoining your family and living out your natural life in freedom,” said Kaplan, who previously questioned the leniency the government showed in its plea offer.

Before pleading guilty in September to making a threat to use an explosive device and conspiracy to murder Americans, Bary had faced life in prison on more than 200 counts of premeditated murder for the embassy bombings in Kenya and Tanzania.

Bary earlier told Kaplan he felt “sorry for all the victims,” adding, “If I could do something to bring all the victims back, I would.”

The plea deal allowed for Bary to receive credit for 14 years he spent behind bars in the United Kingdom and another three years for the time he’s been in custody in America awaiting trial.

Bary’s sentencing took place while one of his co-defendants, Saudi national Khalid al-Fawwaz, is on trial for his alleged participation in the terror attacks that included serving as bin Laden’s representative in London. A third defendant, Libyan Abu Anas al-Liby, died in custody from longstanding medical issues shortly before the trial began in January.

During Friday’s sentencing, Edith Bartley, who lost her father and a brother in the Kenya bombings, urged Kaplan to hold Bary accountable for the “heinous, cowardly and barbaric” attacks.

Bary previously admitted that he and Fawwaz helped disseminate statements of responsibility for a terror group to the media and also threatened “future deaths” by “explosion” if demands were not met. The indictment says he leased a London office that was transformed into bin Laden’s “media information office.”

At the time of Bary’s extradition to the US in 2012, Manhattan US Attorney Preet Bharara referred to him as one of three men “at the nerve centers of al Qaeda’s acts of terror,” adding that “they caused blood to be shed, lives to be lost, and families to be shattered.”