(CNN) A Colorado judge formally sentenced James Eagan Holmes to multiple life terms plus thousands of years in prison for the Aurora movie theater massacre that killed 12 and wounded 70.

Holmes, a 27-year-old former grad student, received one life term for each person he killed , plus 3,318 years for the attempted murders of those he wounded and for rigging his apartment with explosives. He is not eligible for parole.

"It is the court's intention that the defendant never set foot in free society again," Judge Carlos A. Samour Jr. said after imposing the sentence Wednesday. "If there was ever a case that warranted a maximum sentence, this is the case. The defendant does not deserve any sympathy.

"Sheriff, get the defendant out of my courtroom please."

There was a smattering of applause as Holmes, shackled at the waist and wearing red prison garb, was led away from the courtroom where he has spent most of his days since jury selection began in January.

Prosecutor George Brauchler said he believed the sentence was the fourth longest in U.S. history. He described the judge's command to promptly remove Holmes from the courtroom as "the right exclamation point" to bring a painful, difficult trial to a close.

James Holmes appears in court for the sentencing phase in his trial.

Wearing a helmet, gas mask and ballistic gear, Holmes tossed tear gas into Theater 9 of the Century 16 megaplex in Aurora during the first minutes of the midnight show of "The Dark Knight Rises." Armed with a shotgun, a rifle and a pistol, he opened fire on July 20, 2012; he had more than 700 rounds of ammunition with him. After his gun jammed, Holmes walked out of the theater and surrendered.

'Broken brain'

The trial featured graphic descriptions of the gruesome crime scene and heartbreaking stories of the lives taken and shattered by Holmes' bullets.

The testimony also focused on Holmes' mental illness. A notebook containing his rambling thoughts and detailed plans for the massacre, as well as hours of videotaped interviews with a court-appointed psychiatrist, dominated that part of the testimony.

Holmes revealed that he had been obsessed with killing people since his early teens. He said he studied neuroscience in part to fix his own "broken brain." He also said he contemplated suicide before devising a "life capital" plan that awarded him points for each life he took.

The defense portrayed Holmes as a victim of mental illness and brought forward a parade of witnesses who knew him as a sweet, academically gifted child. But prosecutors disdainfully portrayed him as a self-absorbed loser who lashed out violently after setbacks in his love life and his studies.

In the end, the judge found him to be a quitter who gave up on life and vowed to take others with him.

Photos: Colorado massacre: Mourning the victims Photos: Colorado massacre: Mourning the victims Cynthia Davis, center, visits the roadside memorial set up for victims of the Colorado shooting massacre across the street from the Century 16 movie theater on Monday, July 30, 2012, in Aurora, Colorado. Twelve people were killed in the theater early July 20, 2012, during a screening of "The Dark Knight Rises." Suspect James Holmes was taken into custody shortly after the attack. More photos: Colorado movie theater shooting Hide Caption 1 of 52 Photos: Colorado massacre: Mourning the victims People visit the roadside memorial set up for victims of the massacre on Monday. Hide Caption 2 of 52 Photos: Colorado massacre: Mourning the victims Visitors pray around a cross at the memorial across the street from the theater on Saturday, July 28. Hide Caption 3 of 52 Photos: Colorado massacre: Mourning the victims Jeremy Blocker displays a new tattoo honoring the victims. Hide Caption 4 of 52 Photos: Colorado massacre: Mourning the victims Members of Alex Sullivan's family embrace at a memorial across the street from the Century 16 movie theater on Thursday, July 26. Hide Caption 5 of 52 Photos: Colorado massacre: Mourning the victims Hello Kitty-themed flowers are sent to shooting victim Micayla Medek's funeral Thursday in Denver. Hide Caption 6 of 52 Photos: Colorado massacre: Mourning the victims Pallbearers carry Micayla Medek's coffin during her funeral at the New Hope Baptist Church on Thursday. Hide Caption 7 of 52 Photos: Colorado massacre: Mourning the victims People visit a memorial across the street from the Century 16 movie theater on Thursday, July 26, in Aurora, Colorado. Hide Caption 8 of 52 Photos: Colorado massacre: Mourning the victims Angella Aquilis, left, and Maria Olivas mourn together at a makeshift memorial across the street from the Century 16 movie theater Wedesday, July 25. Hide Caption 9 of 52 Photos: Colorado massacre: Mourning the victims Yvonne Amaro, 9, prays for those injured and killed as she visits the memorial on Wednesday. Hide Caption 10 of 52 Photos: Colorado massacre: Mourning the victims Carrie Hensley, left, and Hailee Hensley mourn together on Wednesday. Hide Caption 11 of 52 Photos: Colorado massacre: Mourning the victims Kevin Flynn, left, Aurora Police top brass division chief, and Cmdr. Jack Daluz visit the makeshift memorial. Hide Caption 12 of 52 Photos: Colorado massacre: Mourning the victims A couple embraces as "Dark Knight Rises" star Christian Bale and his wife, Sandra Blazic, wait to place flowers at the memorial on Tuesday. Hide Caption 13 of 52 Photos: Colorado massacre: Mourning the victims Bale places flowers at the memorial while other mourners look on. Hide Caption 14 of 52 Photos: Colorado massacre: Mourning the victims Visitors pay tribute Tuesday, July 24, at the makeshift memorial. Hide Caption 15 of 52 Photos: Colorado massacre: Mourning the victims A cross stands at the makeshift memorial for victims across the street from the Century 16 theater on Tuesday. Hide Caption 16 of 52 Photos: Colorado massacre: Mourning the victims Greg Zanis of Aurora, Illinois, carries two of the 12 crosses he made for a makeshift memorial to the victims of last weekend's mass shooting at the Century 16 movie theater on Sunday, July 22. Hide Caption 17 of 52 Photos: Colorado massacre: Mourning the victims Greg Zanis writes the names of the victims of last weekend's mass shooting on the crosses before erecting them at the memorial across from the Century 16 movie theater on Sunday. Zanis, a carpenter, drove all night from Illinois to deliver the crosses. Hide Caption 18 of 52 Photos: Colorado massacre: Mourning the victims Parishioners pray during morning Mass, remembering victims of the theater shooting, at the Queen of Peace Catholic Church on Sunday. Hide Caption 19 of 52 Photos: Colorado massacre: Mourning the victims Angie Terry of Alabama prays next to a white wooden cross erected for victims. Hide Caption 20 of 52 Photos: Colorado massacre: Mourning the victims A man pauses before the crosses at the memorial near the Century 16 movie theater on Sunday. Hide Caption 21 of 52 Photos: Colorado massacre: Mourning the victims President Barack Obama embraces Colorado Gov. John Hickenlooper as Sen. Mark Udall, left, and Sen. Michael Bennet look on during a visit to the University of Colorado Hospital on Sunday. Hide Caption 22 of 52 Photos: Colorado massacre: Mourning the victims Mourners bow their heads in prayer during the vigil for the victims of the Aurora shooting. Hide Caption 23 of 52 Photos: Colorado massacre: Mourning the victims A woman is overcome with emotion during the vigil. Hide Caption 24 of 52 Photos: Colorado massacre: Mourning the victims Tiffany Garcia, right, and her 6-year-old daughter, Angelina Garcia, cry on Saturday, July 21, as they look at a memorial for the victims of Friday's shooting. Hide Caption 25 of 52 Photos: Colorado massacre: Mourning the victims People pray at a cross erected at the makeshift memorial across the street from the Century 16 theater on Saturday. Hide Caption 26 of 52 Photos: Colorado massacre: Mourning the victims Family, friends and former classmates of movie theater shooting victim A.J. Boik gather for a memorial service at Gateway High School on Saturday. Hide Caption 27 of 52 Photos: Colorado massacre: Mourning the victims Boik and his girlfriend were at the midnight showing of 'The Dark Knight Rises' when a gunman killed Boik and 11 other people. Hide Caption 28 of 52 Photos: Colorado massacre: Mourning the victims Movie theater shooting victim A.J. Boik's girlfriend, Lasamoa Croft, center, embraces his mother during the memorial service. Hide Caption 29 of 52 Photos: Colorado massacre: Mourning the victims Eman Alexander, 17, pins a ribbon on his shirt while joining family, friends and former classmates to honor shooting victim A.J. Boik. Hide Caption 30 of 52 Photos: Colorado massacre: Mourning the victims Denise Toepel of Denver sheds tears while visiting a makeshift memorial across the street from the Century 16 movie theater on Saturday, July 21. Hide Caption 31 of 52 Photos: Colorado massacre: Mourning the victims Handwritten signs decorate the makeshift memorial across from the Century 16 movie theater on Saturday. Hide Caption 32 of 52 Photos: Colorado massacre: Mourning the victims Gerald Wright, 24, relights candles that have blown out at the victims' memorial across from the movie theater. Hide Caption 33 of 52 Photos: Colorado massacre: Mourning the victims Aviation Boatswain's Mate 3rd Class Jajuan Mangual lowers the American flag on the flight deck of the aircraft carrier USS George H.W. Bush to half-mast on Saturday. One U.S. Navy sailor was killed in the shooting and another injured. Hide Caption 34 of 52 Photos: Colorado massacre: Mourning the victims Two women mourn near the theater on Saturday. Hide Caption 35 of 52 Photos: Colorado massacre: Mourning the victims Alicia Prevette, left, and Paul Stepherson attend a vigil for the victims Friday at the Century 16 movie theater. Hide Caption 36 of 52 Photos: Colorado massacre: Mourning the victims A woman lights a candle at a makeshift memorial where the victims of the massacre are mourned. Hide Caption 37 of 52 Photos: Colorado massacre: Mourning the victims Mourners hold hands at a vigil near the theater. Hide Caption 38 of 52 Photos: Colorado massacre: Mourning the victims Mourners hug as they grieve the loss of the victims. Hide Caption 39 of 52 Photos: Colorado massacre: Mourning the victims A group of teenagers stand behind a sign that reads "Strength." Hide Caption 40 of 52 Photos: Colorado massacre: Mourning the victims Dara Anderson, left, and Monique Anderson cry during a candlelight vigil across the street from the crime scene. Hide Caption 41 of 52 Photos: Colorado massacre: Mourning the victims A woman holds a lit candle at a makeshift memorial. Hide Caption 42 of 52 Photos: Colorado massacre: Mourning the victims Marietta Perkins of Denver prays for victims and their families. Hide Caption 43 of 52 Photos: Colorado massacre: Mourning the victims Lonnie Delgado, right, hugs Heaven Leek during a prayer. Hide Caption 44 of 52 Photos: Colorado massacre: Mourning the victims A mourner grieves on the curb during a memorial service. Hide Caption 45 of 52 Photos: Colorado massacre: Mourning the victims People hug during a vigil for the victims. Hide Caption 46 of 52 Photos: Colorado massacre: Mourning the victims Handwritten consolation letters lie beneath flowers at a makeshift memorial. Hide Caption 47 of 52 Photos: Colorado massacre: Mourning the victims Nathan Mendoza, left, and Melissa Clark sit on the grass during a vigil. Hide Caption 48 of 52 Photos: Colorado massacre: Mourning the victims Flags, flowers and candles make up a memorial site. Hide Caption 49 of 52 Photos: Colorado massacre: Mourning the victims Two mourners sit on the ground at a vigil. Hide Caption 50 of 52 Photos: Colorado massacre: Mourning the victims A sign prevents moviegoers from wearing masks or bringing in props to the AMC Arapahoe Crossing 16 movie theater in Aurora. Hide Caption 51 of 52 Photos: Colorado massacre: Mourning the victims A woman looks at a makeshift memorial after attending a candlelight vigil. Hide Caption 52 of 52

A jury rejected Holmes' insanity defense and convicted July 16 him of 24 counts of murder, 140 counts of attempted murder and a single explosives charge. But the jury could not agree on the death penalty; there was a lone holdout.

Holmes received the only alternative on the 24 murder counts -- life sentences without parole, to be served consecutively. The additional years, which cover the attempted murder and explosives convictions, will be served consecutively to the murder sentences. The judge merged the two convictions for each victim into a single count.

Depression, night terrors, survivor's guilt

More than 100 shooting survivors and friends and relatives of the people he killed offered heartbreaking testimony about their loss at the formal sentencing hearing, which began on Monday. Some called Holmes a monster and said he had cheated the executioner.

They spoke of holidays, weddings and graduations that won't be celebrated, and about depression, night terrors and survivor's guilt. Some have yet to set foot in a movie theater.

Holmes' mother, Arlene, apologized to the victims -- but he remained silent. She said he is remorseful as well, but his schizophrenia and the medication he takes make it difficult for him to express his feelings.

His defense attorneys have said they will not appeal Holmes' convictions or the sentence, noting that Holmes offered early on to plead guilty if prosecutors took the death penalty off the table.

Before issuing the formal sentence, Samour defended the criminal justice system, saying it worked even if some people were not happy that Holmes didn't receive the death penalty.

He said he understands why some survivors are disappointed and noted that the lone holdout juror showed more compassion toward Holmes than the defendant ever showed his victims.

"The jury was not able to return the sentencing verdicts you were hoping for," Samour said. "It feels like rejection. It feels like you were asking for something and were rejected. It feels like defeat."

He assured them it was not. He pointed out that the mandatory life sentences, and the decision not to appeal, means the case ends now and the victims can finally move on with their lives. Had Holmes gotten a death sentence, the case would have dragged on, possibly for decades.

"Either way you look at it, the defendant is going to die in the custody of a department of corrections," Samour said. "Death is certain, the only question is when."

Photos: Colorado movie theater massacre The public gets its first glimpse of James Holmes, then 24, the suspect in the Colorado theater shooting during his initial court appearance July 23, 2012. With his hair dyed reddish-orange, Holmes, here with public defender Tamara Brady, showed little emotion. He is accused of opening fire in a movie theater July 20, 2012, in Aurora, Colorado, killing 12 people and wounding 70. Holmes faces 166 counts, almost all alleging murder or attempted murder. He has pleaded not guilty by reason of insanity. More photos: Mourning the victims of the Colorado theater massacre Hide Caption 1 of 45 Photos: Colorado movie theater massacre Police release the official photo from Holmes' booking after the shooting. Hide Caption 2 of 45 Photos: Colorado movie theater massacre Holmes often had a blank stare during his July 23, 2012, court appearance, seeming to be in a daze. Hide Caption 3 of 45 Photos: Colorado movie theater massacre Victims and their relatives and journalists watch the proceedings in 2012. Hide Caption 4 of 45 Photos: Colorado movie theater massacre Flags fly at half-staff on July 23, 2012, at the Arapahoe County Courthouse in Centennial, Colorado, where the movie theater shooting suspect had his first court appearance. The murder counts against Holmes carry a possible death penalty. Hide Caption 5 of 45 Photos: Colorado movie theater massacre Arapahoe County District Attorney Carol Chambers talks to reporters July 23, 2012, before heading into the courthouse. The murder counts against Holmes carry a possible death penalty. Hide Caption 6 of 45 Photos: Colorado movie theater massacre Family members of the victims arrive at the courthouse July 23, 2012, for the suspect's first court appearance. Hide Caption 7 of 45 Photos: Colorado movie theater massacre The Century Aurora 16 multiplex in Aurora becomes a place of horror after a gunman opened fire July 20, 2012, in a crowded theater. Hide Caption 8 of 45 Photos: Colorado movie theater massacre Holmes is accused of opening fire during a midnight screening of the Batman movie "The Dark Knight Rises." Holmes purchased four weapons and more than 6,000 rounds of ammunition, police say. Hide Caption 9 of 45 Photos: Colorado movie theater massacre Police investigate outside the Century 16 multiplex July 21, 2012, a day after the mass shooting. Hide Caption 10 of 45 Photos: Colorado movie theater massacre Agents search the suspect's car outside the theater. Hide Caption 11 of 45 Photos: Colorado movie theater massacre Aurora police escort a sand-filled dump truck containing improvised explosive devices removed from Holmes' booby-trapped apartment on July 21, 2012. Authorities have said they believe the suspect rigged his place before leaving for the movie theater. Hide Caption 12 of 45 Photos: Colorado movie theater massacre Police break a window at the suspect's apartment July 20, 2012, in Aurora. Hide Caption 13 of 45 Photos: Colorado movie theater massacre Law enforcement officers speak with Colorado Gov. John Hickenlooper, center, outside the suspect's apartment July 21, 2012. Hide Caption 14 of 45 Photos: Colorado movie theater massacre Law enforcement officers prepare to disarm the booby-trapped apartment July 21, 2012. Hide Caption 15 of 45 Photos: Colorado movie theater massacre Officials tow cars outside Holmes' apartment July 21, 2012. Police disassembled devices and trip wires set up in the apartment. Hide Caption 16 of 45 Photos: Colorado movie theater massacre Officers prepare to place an explosive device inside the apartment. Hide Caption 17 of 45 Photos: Colorado movie theater massacre Debris flies out a window, right, after law enforcement officers detonate an explosive device inside the apartment July 21, 2012. Hide Caption 18 of 45 Photos: Colorado movie theater massacre People mourn the victims during a vigil behind the theater where a gunman opened fire on moviegoers in Aurora. Hide Caption 19 of 45 Photos: Colorado movie theater massacre A woman grieves during a vigil for victims behind the theater. Hide Caption 20 of 45 Photos: Colorado movie theater massacre A distraught woman receives counseling from the Rev. Quincy Shannon, left, in front of Gateway High School in Aurora, where the families of the missing met after the shooting. Hide Caption 21 of 45 Photos: Colorado movie theater massacre Lin Gan of Aurora holds back tears as she speaks to reporters about her experience in the Century 16 theater. Hide Caption 22 of 45 Photos: Colorado movie theater massacre People embrace before a vigil for victims behind the theater where a gunman opened fire on moviegoers. Hide Caption 23 of 45 Photos: Colorado movie theater massacre Investigators work on evidence near the apartment of James Holmes on July 20, 2012. Hide Caption 24 of 45 Photos: Colorado movie theater massacre Members of the Aurora Police Department SWAT unit walk near the Holmes' apartment. Hide Caption 25 of 45 Photos: Colorado movie theater massacre Television news crews gather in front of the home of Robert and Arlene Holmes, parents of suspect James Holmes, in San Diego on July 21, 2012. Hide Caption 26 of 45 Photos: Colorado movie theater massacre A popcorn box lies on the ground outside the Century 16 movie theater. Hide Caption 27 of 45 Photos: Colorado movie theater massacre Adariah Legarreta, 4, is comforted by her grandmother Rita Abeyta near the Century 16 Theater in Aurora. Hide Caption 28 of 45 Photos: Colorado movie theater massacre Jessica Ghawi, an aspiring sportscaster, was one of the victims. Hide Caption 29 of 45 Photos: Colorado movie theater massacre A woman waits for news outside Gateway High School, a few blocks from the scene of the shooting at the Century Aurora 16. Hide Caption 30 of 45 Photos: Colorado movie theater massacre Aurora police chief Daniel J. Oates speaks at a press conference near the Century 16 Theater on July 20, 2012. Hide Caption 31 of 45 Photos: Colorado movie theater massacre Agents search the trash container outside the suspect's apartment in Aurora. Hide Caption 32 of 45 Photos: Colorado movie theater massacre A Federal ATF officer carries protective gear onsite at the home of the shooting suspect. Hide Caption 33 of 45 Photos: Colorado movie theater massacre President Obama speaks on the shootings at a July 20, 2012, event in Fort Myers, Florida. Hide Caption 34 of 45 Photos: Colorado movie theater massacre Moviegoers are interviewed at the Century Aurora 16. Hide Caption 35 of 45 Photos: Colorado movie theater massacre Officers gather at the theater July 20, 2012. Hide Caption 36 of 45 Photos: Colorado movie theater massacre Investigators were a common sight at the theater on July 20, 2012. Hide Caption 37 of 45 Photos: Colorado movie theater massacre Authorities gather at the shooting suspect's apartment building in Aurora. Police broke a second-floor window to look for explosives the suspect claimed were in the apartment. Hide Caption 38 of 45 Photos: Colorado movie theater massacre Screaming, panicked moviegoers scrambled to escape from the black-clad gunman, who wore a gas mask and randomly shot as he walked up the theater's steps, witnesses said. Hide Caption 39 of 45 Photos: Colorado movie theater massacre Onlookers gather outside the Century Aurora 16 theater. Hide Caption 40 of 45 Photos: Colorado movie theater massacre A woman sits on top of her car near the crime scene. Hide Caption 41 of 45 Photos: Colorado movie theater massacre Police block access to the Town Center mall after the shooting. Hide Caption 42 of 45 Photos: Colorado movie theater massacre Cell phone video taken by someone at the theater showed scores of people screaming and fleeing the building. Some, like this man, had blood on their clothes. Hide Caption 43 of 45 Photos: Colorado movie theater massacre Witnesses told KUSA the gunman kicked in an emergency exit door and threw a smoke bomb into the darkened theater before opening fire. Hide Caption 44 of 45 Photos: Colorado movie theater massacre What is believed to be the suspect's car is examined after the shooting. Hide Caption 45 of 45

He rejected criticism that the trial was a waste of time and money, since Holmes would have ended up with the same sentence had the state agreed to drop the death penalty in exchange for a guilty plea.

"Since when do we as a nation, as a community, put money ahead of everything else? When did that happen?" the judge asked.

'He robbed the world'

Samour said the trial provided a platform for the community to know the people who were lost, and to learn about how such horrific, violent acts affect hundreds if not thousands of people. He said we were able to learn about the issue of mental illness and that we are still far from any real understanding about it. He said even the experts who testified would agree that the field of psychiatry has a long way to go.

Samour also noted that there was a fork in the road at which Holmes could have turned back, but didn't. That was when he was outside the theater and tried to call his therapist.

The judge took pains to name each victim -- Jonathan Blunk, A.J. Boik, Jesse Childress, Gordon Cowden, Jessica Ghawi, John Larimer, Matthew McQuinn, Micayla Medek, Veronica Moser-Sullivan, Alex Sullivan, Alex Teves and Rebecca Wingo -- and offer up personal details provided by family members during the trial.

"We will never know what they would have accomplished. We will never know what impact they would have made in the world," Samour said. "The defendant robbed not only the family members and friends of these victims, he robbed the world of all these deceased victims would have accomplished."