CNN  — 

A federal appeals court ruled on Friday to vacate the death sentence of Dzhokhar Tsarnaev, who along with his brother planted homemade bombs near the finish of the 2013 Boston Marathon, killing three spectators and injuring hundreds.

The court also ruled to set aside three of his 30 convictions but said he will remain in federal prison for the rest of his life.

The court ruled Tsarnaev should be given a new penalty phase trial, where a new set of jurors can again decide if he should be sentenced to death. Tsarnaev, now 27, will remain incarcerated and is being held at the nation’s most secure federal prison in Florence, Colorado.

“And just to be crystal clear: Because we are affirming the convictions (excluding the three … convictions) and the many life sentences imposed on those remaining counts (which Dzhokhar has not challenged), Dzhokhar will remain confined to prison for the rest of his life, with the only question remaining being whether the government will end his life by executing him,” the opinion, authored by Circuit Court Judge Ojetta Rogeriee Thompson, says.

Tsarnaev was convicted in 2015, including for the deaths of Krystle Campbell, Martin Richard, Lingzi Lu at the marathon and police officer Sean Collier, separately.

Around-the-clock coverage

Tsarnaev’s legal team had pushed to change the venue of the trial to a courthouse that wasn’t so close to the site of the bombing, in the heart of a town so affected by the tragedy. The appeals court judges agreed, saying, “One could not turn on the radio either without hearing something about these stunningly sad events.”

The appeals judges ruled that US District Court Judge George O’Toole, who oversaw Tsarnaev’s trial, “fell short” of his promise to question jurors thoroughly enough to identify the degree to which they had been exposed to facts of the case through media coverage, “providing sufficient ground to vacate his death sentences.”

Part of the appeals court’s ruling was a decision to reverse three convictions for charges that Tsarnaev was carrying a firearm in connection with his possession of a pressure cooker bomb. The ruling tells the district court to enter judgments of acquittal on those charges, put together a new jury and preside over a new trial that strictly focuses on what penalty Tsarnaev should receive for the counts that are eligible for the death penalty. Tsarnaev’s attorneys had filed a post-trial motion for judgments of acquittal on these convictions that the district court judge denied.

CNN has reached out to Tsarnaev’s legal team for comment on the ruling.

The ruling also states that the judges make no judgment about whether Boston is a “proper venue” for a sentencing retrial, and says it is a decision that should be left to the US District Court for Massachusetts, where the initial trial was held.

The US Attorney’s office said: “We are currently reviewing the opinion and are declining further comment at this time.”

Tsarnaev was 19 years old when he and his brother, Tamerlan, who was 26 years old at the time, went to Boston’s Boylston Street shortly before 3 p.m. on April 15, 2013, to carry out their plot.

Surveillance video showed the brothers carrying the pressure cooker bombs in backpacks and moving through the crowd near the marathon finish line in what federal prosecutors called a coordinated attack.

Tamerlan set off the first bomb, a 6-quart pressure cooker that contained gunpowder, nails and BBs, prosecutors said. The bomb killed Campbell, a 29-year-old restaurant manager, and permanently injured several other people who lost their legs.

The second pressure cooker bomb, carried in by Dzhokhar, went off 12 seconds later and killed two people, Martin and Lu, a graduate student from China.

The bombings sparked a manhunt for days that shut down the city and resulted in wall-to-wall coverage of the search. The brothers, while on the run, killed Massachusetts Institute of Technology police officer Sean Collier. After they stole an SUV, the two were chased by police.

Tamerlan died in an explosive firefight with police in nearby Watertown. Dzhokhar was arrested a day later.

Victims, families to relive another trial

The decision to order a new trial will be difficult for the families of victims, Boston Mayor Marty Walsh said after the decision came down on Friday.

“I think the concern that some families have had from the very beginning was that this day was going to come, where they would have to relive another trial, and you know they shouldn’t have to relive another trial,” Walsh said. “The only thing that I’ll say is a positive … this guy will never see the light of day again. He’s going to live within those four walls. He got exactly what he deserved.”

Shortly after Tsarnaev was found guilty on all counts, the parents of 8-year-old Martin Richard, who was killed in the bombing, publicly pleaded for prosecutors not to pursue the death sentence in the penalty phase of the trial.

“We hope our two remaining children do not have to grow up with the lingering, painful reminder of what the defendant took from them, which years of appeals would undoubtedly bring,” the parents wrote in a column in The Boston Globe. “As long as the defendant is in the spotlight, we have no choice but to live a story told on his terms, not ours. The minute the defendant fades from our newspapers and TV screens is the minute we begin the process of rebuilding our lives and our family.”

CNN has reached out to the Richard family for comment on Friday’s ruling.

CNN’s Mark Morales and Steve Almasy contributed to this report.