A judge sentenced 42-year-old Brendan O'Rourke Friday for the October 2010 attack at Kelly Elementary School in Carlsbad that injured two second-grade girls before three construction workers wrestled the shooter to the ground.
In March, a jury in Vista convicted O'Rourke of premeditated murder and assault with a firearm. The jury found he was sane at the time of the attack.
O'Rourke had a .357 Magnum revolver, extra ammunition, a gas can and matches when he opened fire at the school playground where there were 230 children.
The U-T San Diego newspaper reports that Superior Court Judge Aaron Katz issued the sentence Friday.
The girls who were injured have recovered.
Carlsbad is a coastal community 35 miles north of downtown San Diego.
More on Crimesider