The gunman, named as 53-year-old Cedric Anderson, shot dead his estranged wife, a teacher, and wounded two children who were behind her, one of whom died of his wounds.
He then turned the gun on himself, police said.
Police chief Jarrod Burguan described the incident as a suspected “murder-suicide” attempt.
The shooting happened at 10:30 local time at North Park Elementary School in San Bernardino county, 60 miles east of Los Angeles.
The gunman had gained entry to the school as a visitor and kept his weapon concealed until he opened fire in the classroom where 15 children with special needs were being taught, authorities said.
Cedric Anderson killed his wife Karen Elaine Smith and fatally wounded 8-year-old Jonathan Martinez, who was airlifted to hospital but later died.
A 9-year-old pupil remains in hospital in a stable condition, the Los Angeles Times reported.
Jarrod Burguan tweeted shortly after the incident that the suspect was “down” and there was “no further threat”. The school was immediately evacuated.
Up to 600 students were transferred by bus to nearby Cajon High School, where they were later met by their parents.
“Police operations are continuing to secure the area,” Jarrod Burguan said earlier on Twitter.
He added: “However, we do believe the threat is down.”
In December 2015, 14 people were killed and 21 others wounded when a couple entered a disabled service centre in San Bernardino and began firing at a group of county health workers.
The dental health industry is undergoing an unprecedented transformation, driven by technological innovations and a…
In recent years, the medical field has observed a significant increase in the number of…
Whether you're considering selling your home soon or simply looking to enhance its long-term value,…
Three Indian nationals have been arrested and charged over the killing of Sikh separatist leader…
President Joe Biden has urged pro-Palestinian protesters on university campuses to uphold the rule of…
Blue Ivy Carter has joined the voice cast of The Lion King prequel Mufasa: The…