CENTENNIAL, Colo. — In a decision that surprised many in this community, a jury sentenced James E. Holmes on Friday to life in prison with no chance of parole, rejecting the death penalty for the man who carried out a 2012 shooting rampage that killed 12 people in a Colorado movie theater.

As the courtroom waited for Judge Carlos Samour Jr. to review the verdict, only the sound of him turning pages could be heard. Family members of the dead who sat through three months of wrenching, sometimes grisly testimony held hands and closed their eyes. Mr. Holmes stood flanked by his lawyers, one of them holding his arm. A few feet away, his parents stood up to see better and gripped each other.

Then the judge read each sentence of life, noting that jurors were unable to reach a unanimous verdict on any of the counts against Mr. Holmes. In Colorado, death sentences must be unanimous. If even one person dissents, the sentence is life in prison.

After court on Friday, a juror who identified herself only by her juror number — 17 — said one juror had solidly opposed death. Nine jurors had favored death and two were unsure, but one wanted a life sentence.