A former Osama bin Laden aide who stabbed a federal prison guard in the eye was sentenced Tuesday to life in prison after telling the court he's not a terrorist and hearing his victim tell him he will go to hell.

U.S. District Judge Deborah Batts said Mamdouh Mahmud Salim, 52, deserved a life sentence for his "unusually cruel, brutal" attack in 2000 on guard Louis Pepe at the Metropolitan Correctional Center in lower Manhattan. She ordered Salim to pay $4.72 million in restitution to cover the medical expenses for Pepe's continuing rehabilitation.

The stabbing left Pepe brain-damaged and blind in one eye. The sentence caused Pepe's sister, Eileen Trotta, to thrust her fists in the air enthusiastically and to pat Pepe on the back. More than a half-dozen guards who watched the proceeding congratulated a smiling Pepe afterward as he rolled his wheelchair out of court.

Pepe, asked how he felt, said, "Pretty good."

The sentence for Salim was actually a resentencing, since a federal appeals court said in December 2008 that the judge should have imposed a terrorism enhancement to the guilty pleas he entered to crimes of conspiracy to murder a federal official and attempted murder of a federal official. The judge originally sentenced Salim in 2004 to 32 years in prison.

Salim, who before the Sept. 11 attacks was believed to be the highest-ranking al-Qaida member held in the United States, was not in court but appeared by video on courtroom monitors. He was handcuffed and shackled at the waist on a chair in front of rows of books at the maximum-security Supermax prison in Florence, Colo. He kept his head tilted against a phone resting on his shoulder.

Salim did not show emotion as Pepe addressed him directly, beginning in a conversational tone: "Hi, Salim. How are you doing? You look better than ever. I look pretty bad now."

Pepe told Salim that he can't walk anymore and it's difficult to talk. He also told Salim that Salim's not going to be a martyr.

"You're going to hell," he said.

Then he reached into a small bag at the side of his wheelchair, saying he had something for Salim. He pulled out a doughnut, saying, "That's for you Salim," as he tried to give it to Salim's lawyer, who did not turn around to accept it.

Pepe's sister said outside court that Pepe had been known as Pepsi by co-workers because he always brought them sodas and coffees.

"He wanted to show, 'I'm on top,' that he was giving something," she said.

Outside court, Pepe smiled and said: "I'm glad he's finished, but I'm glad he got his little doughnut."

Salim spoke in English, saying: "I'm not a criminal. I'm not a terrorist." He said the stabbing occurred on Nov. 1, 2000, as he was trying to get to his defense lawyers to force them out of the case because he believed they were federal agents. He sought a set of keys from Pepe to enter a room where the lawyers were waiting for him.

He sprayed Pepe with hot sauce to blind him before stabbing him in the eye with a sharpened comb he had hidden in his cell in a high-security wing of the federal lockup next to federal court. He has said he intended to stab the lawyers so they could no longer represent him.

At the time, Salim was awaiting trial on a conspiracy charge after his arrest in the August 1998 bombings of two U.S. embassies in Africa. The attacks killed 224 people, including a dozen Americans.

Salim said he requested not to be taken to court Tuesday because he gets beaten by guards whenever he is moved from one prison to another.

Of Pepe, Salim said: "If the victim here wants to take my eye, let him take my eye. If he wants to take my hand, let him take my hand."

At the 2004 sentencing, Salim had called the attack "the biggest mistake in my life."

Salim's lawyer, Richard Lind, who had argued for the sentence to remain at 32 years, said he will appeal again.