(Associated Press) - Boston Marathon bomber Dzhokhar Tsarnaev says that he's sorry for the irreparable harm he's caused and that he prays for the victims.

Tsarnaev addressed the court for the first time Wednesday at his sentencing hearing. He gave a five-minute speech with a Russian accent, peppered with religious references and praise of Allah.

The 21-year-old paused several times, looking as if he was trying to remain composed. He stood and faced the judge while speaking, but spoke of the victims.

He says he listened to everyone who spoke on the witness stand and he noted the strength, patience and dignity of the survivors. He also said he's sorry for the lives he's taken.

During his trial, a Roman Catholic nun who visited him said he expressed sympathy for the victims, but he has never said so publicly.
Also on Wednesday, a federal judge formally sentenced Tsarnaev to death for the 2013 terror attacks.

U.S. District Judge George O'Toole Jr. pronounced the sentence in Boston. He was required under law to impose the jury's death sentence for the April 15, 2013, attack that killed three people and wounded more than 260 others.

The judge says no one will remember that his teachers or friends were fond of him. He says what they will remember is that Tsarnaev ``murdered and maimed innocent people'' and ``did it willfully and intentionally.''

Tsarnaev looked down and rubbed his hands together as the judge sentenced him.

An appeal is automatic in death penalty cases.