Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Dzhokhar Tsarnaev finally broke his silence Wednesday, apologizing in court to the victims of the Boston Marathon bombings. Moments later, he was formally sentenced to die for the attack.

“You told us just how unbearable it was, this thing I put you through,” Tsarnaev said at a hearing in Boston. “Now, I am sorry for the lives that I have taken.”

“I ask Allah for his mercy for me and my brother and my family,” he said.

Related: Read the Boston Marathon Bomber's Full Statement

Tsarnaev stood as he spoke, and the courtroom was extraordinarily quiet. He paused at each sentence and appeared to tremble. Some victims had gathered in court to hear him. Few appeared to react to what he said.

Judge George O’Toole was bound to follow the wishes of the jury, which convicted Tsarnaev in April and voted the death penalty last month. He formally pronounced the sentence after delivering a blistering rebuke of Tsarnaev.

“No one will remember your teachers were fond of you,” the judge said. “What will be remembered is that you murdered and maimed innocent people.”

O’Toole spoke of the bravery of people who were grievously wounded in the attack and still managed to help others.

The sentence was given two years and two months after twin pressure-cooker bombs exploded near the finish line of the marathon, killing three people and wounding more than 260. A campus police officer was shot to death by Tsarnaev and his older brother, Tamerlan, three days after the blasts.

Related: Tsarnaev Bound For Death Row Where Death Is Rare

Tamerlan Tsarnaev was killed in a shootout with police. Dzhokhar was cornered in a boat behind a house in the Boston suburb of Watertown.

Dzhokhar Tsarnaev will probably end up on federal death row in Terre Haute, Indiana. Because of appeals, it will probably be years before he is executed.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

At the sentencing, it was not clear whether Tsarnaev would speak until moments before he rose.

At the trial earlier this year, the public only heard from Tsarnaev indirectly. A nun quoted him as having expressed remorse. And he showed little emotion. One day he wiped his eyes with a tissue when his aunt took the stand and broke down in tears.

In his brief remarks on Wednesday, Tsarnaev spoke of “the strength, the patience, the dignity” of victims of the blasts who had testified earlier.

“I am a Muslim. My religion is Islam. I pray to Allah to show his mercy to the deceased in this bombing,” he said.

Earlier in the day, one victim after another had addressed Tsarnaev in court and unleashed rage and grief.

“The choices that you made are despicable,” said Patricia Campbell, whose daughter, Krystle, was killed at the marathon.

“I will never have a complete family again,” said Jennifer Rogers, the sister of Sean Collier, the MIT police officer shot to death days later.

And Karen McWatters, a friend of Campbell’s, looked at Tsarnaev and said: “You will die in prison alone.”

The victims spoke in quick succession and with powerful language.

"In the end you failed," said Ed Fucarile, whose son, Marc, was severely injured in the bombing. "As a city and a country we became stronger."

Some were defiant. Rebekah Gregory mocked Tsarnaev for fiddling with his pencil and cracking jokes with his lawyers.

"You made us stronger," she said. "We are Boston strong and America strong, and choosing to mess with us was a bad idea. How was that for your victim impact statement?"

Richard “Dic” Donohue, a Boston transit police officer who was injured in a gunfight with the Tsarnaev brothers, said that he could no longer run or swim, and that he almost died.

“Let me be clear on one thing,” he said. “I’m still standing here.”

Bill Richard, the father of Martin Richard, the 8-year-old boy killed in the attack, said that Tsarnaev could have changed his mind but chose hate, destruction and death.

“We chose love, we chose kindness, we chose peace,” he said. “That is what makes us different from him.”

Richard and others said that they would prefer that Tsarnaev spend life in prison to think about what he had done.

Marathon victims described lost limbs, broken lives and mental anguish that endured long after the surgeries were over.

“That day will never leave me no matter how much therapy I have,” said Ericka Brannock, who said she had undergone 21 operations, including on her legs and eardrums. Still she vowed: “What they did will not break my spirit.”

And Henry Borgard, who arrived at court with with his service dog, Friday, said that he still wakes up screaming from nightmares and can no longer go to the Fourth of July parade. He said he suffered a concussion in the blast and had to teach himself to read again.

"Every time I call my mom now," he said, "she asks if I'm OK and not hello."

He said he was grateful to have his life. Then he said he forgave Tsarnaev.