NEW YORK — Following emotional testimony from relatives and comrades of his victims, a senior al-Qaeda member was sentenced Friday to life in prison for conspiring to kill American troops in Afghanistan and plotting to bomb the U.S. Embassy in Nigeria.

Ibrahim Suleiman Adhan Adam Harun, 47, or Spin Ghul, as he was known to fellow militants, is “a person of murderous zeal,” a visibly angered U.S. District Judge Brian M. Cogan said before imposing the sentence.

“This defendant killed two young men . . . and he wanted to kill dozens if not hundreds of other Americans. I can’t think of a more serious crime.”

The sentencing capped an investigation that spanned seven years and several continents and came nearly one year after Harun’s trial and conviction — the first such outcome in an international terrorism case under Attorney General Jeff Sessions. Harun, who is incarcerated in a New York City jail, refused to appear in court Friday, just as he refused to be present for his trial in the Eastern District of New York.

But the brother of Army Pfc. Jerod Dennis addressed Harun, nonetheless, standing at a courtroom lectern and recounting how “Jerod was more than just a big brother. He would walk into any room and flood it with laughter and smiles.”

Since the battle on April 25, 2003, that ended his brother’s life, “I have not stopped looking for him everywhere I go and in every face I encounter,” said Jordan Dennis, who was 15 when Jerod was killed at age 19.

“I have every right to hate you, to curse you,” he said, as his words were translated into Hausa and relayed through a video feed to Harun in his jail cell. “But you, your anger, your rage . . . your guns and bullets and tools of harm — all of that is just background noise to the true tragedy here: Jerod’s absence. Our loss.”

In the courtroom were Jerod Dennis’s sister and mother, who flew in from Dallas for the sentencing. Two fellow service members also traveled to Brooklyn to describe how the battle and the loss of their comrades, Dennis and Airman 1st Class Raymond Losano, 24, have scarred them.

“I will never forget the expression on Private 1st Class Jerod Dennis’s face,” said David Cyr Jr., a retired sergeant first class who was Dennis’s team leader. “The last time I looked upon him it was the face of a confident and courageous warrior. . . . He’s no longer here.”

Said Cyr, his voice breaking: “Should I speak about the survivors’ guilt that is my burden to this day?”

Brian Severino, a command sergeant major who is four days shy of retiring from the Army, said none of the battles he has fought during five tours in Afghanistan and Iraq affected him like the one that killed Losano and Dennis.

He “separated” himself from his family as a result, Severino said, and has been unable to enjoy a normal life. “I let down Jared and Ray Losano by not protecting them and failed to bring them home,” he said, his voice trembling. “It’s weighed on me” ever since.

Harun has been in U.S. custody since 2012 and has insisted that he is a fighter for al-Qaeda, one deserving of a trial in “the world court” or in a military tribunal.

Cogan rejected the defense team’s argument that Harun should receive a more lenient sentence because he was acting as a “mere soldier” in Afghanistan and his offenses did not constitute a war crime. “I do not think there was anything ‘mere’ about this soldier,” Cogan said. “It seems to me he was middle management or upper middle management” in al-Qaeda.

Harun, who was born in 1971 when his parents were on a pilgrims’ journey to Mecca in Saudi Arabia, knew many senior al-Qaeda figures.

He discussed his future with commander Abdul Hadi al-Iraqi and asked external operations chief Abu Faraj al-Libi to entrust him with the embassy bomb plot.

Harun reported to Hamza Rabia, a senior external operations official, who arranged for him to train in explosives and poisons with Abu Khabab al-Masri, a top al-Qaeda weapons expert.

He met Ramzi Binalshibh, who would become a 9/11 hijacker.

He was sent by al-Qaeda to West Africa to establish a link with the leaders of what would become Boko Haram.

“He was present at the creation,” said David Bitkower, one of the prosecutors who investigated the case and, although he left the government, returned to Brooklyn for the sentencing.

From childhood, Harun wanted to be a mujahideen and fight the Soviets in Afghanistan. “I’ve always wanted to go to jihad,” he told investigators.

After the 2003 battle, and his failed embassy bomb plot, he fled to Niger and then to Libya. He was detained in 2005 and, after his release six years later, he was put on a boat with refugees bound for Italy. Authorities there detained him and contacted FBI agent Ari Mahairas in New York, who also was present for Harun’s sentencing.

Italy extradited Harun in October 2012.

On Friday, Cogan said he would not order supervised release. “If this man ever walks the street again, the first thing he will do is try to kill Americans,” he said. “There is not an ounce of remorse.”

In his statement, Jordan Dennis, now a lawyer in Oklahoma City, told Harun that “Jerod’s 19 years of impact on this world was far stronger and more powerful than your few seconds you spent trying to destroy it.”

And “because of Jerod,” he said, he forgave Harun.

Harun is expected to appeal his sentence.