Charles "Andy" Williams didn't explain why he opened fire with his father's handgun at Santana High School in Santee on March 5, 2001 but said he felt "horrible about what happened."
"If I could go back to that day, I would never have gotten out of bed," the 16-year-old said, his voice breaking.
Prosecutors had asked the judge to impose the maximum sentence of 425 years, saying Williams coolly planned the assault at the suburban San Diego school and shot classmates as they ran in terror.
Deputy District Attorney Kris Anton said the harassment Williams said he suffered, such as having his skateboard stolen or being knocked in the chin, did not justify the shooting rampage.
"The defendant is the bully. He took a gun to school and shot innocent kids," Anton said.
Judge Herbert Exarhos called the attack vicious and fiendish, but noted that Williams had endured a difficult home life and had no prior history of criminal behavior. He said the question of why Williams committed the attack remain unanswered.
"In all likelihood, it is a question the defendant will be struggling with daily to answer for himself," Exarhos said.
In June, Williams pleaded guilty to two counts of murder and 13 counts of attempted murder. The assault at the 2,000-student campus killed Bryan Zuckor, 14, and Randy Gordon, 17, and wounded 11 other students, a teacher and a campus monitor.
Ray Serrato, a student who still has a bullet lodged in his back, said he has forgiven Williams, but continues to suffer emotionally.
"I not only lost my best friend, Randy Gordon, I lost my innocence, my security," Serrato said. "Fifty years is not enough."
The teen's father has said his son, then 15, was the victim of frequent bullying after moving to Santee from Twentynine Palms, a desert community east of Los Angeles. Previously he had lived in the small town of Brunswick, Md.
The judge had said Williams will go to state prison but won't be housed with adults until he turns 18.
The attack, which came nearly two years after the 1999 massacre at Columbine High School in Colorado, was the first of two shootings in two weeks at schools in San Diego suburbs.
On March 22, 2001, Jason Hoffman, a student with a history of mental illness, wounded five people at Granite Hills High School in El Cajon. He pleaded guilty to attempted murder and assault, then hanged himself in jail. He was 18.