A teacher has been shot dead by her husband at a California school, with an eight-year-old child also killed before the gunman turned the weapon on himself.

Another child was critically injured in the shooting in a special needs classroom at North Park Elementary School in San Bernardino on Monday at around 10.30am.

Police said the suspect, identified as Cedric Anderson, entered the classroom and fatally shot his wife, Karen Smith, without saying anything. The child victim has been identified as Jonathan Martinez.

"Both the students were behind the teacher when the suspect shot his wife," police chief Jarrod Burguan told reporters.

Mr Burguan said the shooter and his wife had recently become estranged.

Lieutenant Mike Madden from San Bernardino Police labelled the shooting as a "tragic incident".

He described the condition of the two injured pupils as "critical".

"This does appear to be a murder-suicide with both male adult and female adult victims succumbing to injures - the male to a self-inflicted gunshot wound," he said.

San Bernardino City Unified School District spokeswoman Maria Garcia told local media it was believed the teacher knew who the shooter was.

And San Bernardino's mayor said it was not believed that children were the target.

Ms Garcia added all other pupils were safe and were being taken to a local college campus.

He said the gunman was using a revolver, which he reloaded during the shooting, but it is not known exactly how many shots were fired.

Lieutenant Mike Madden from San Bernardino Police said the shooting was a "tragic incident".

"This does appear to be a murder-suicide with both male adult and female adult victims succumbing to injures - the male to a self-inflicted gunshot wound," he said.

San Bernardino's mayor said it was not believed that children were the target of the shooting.

San Bernardino City Unified School District spokeswoman Maria Garcia said all other pupils were safe and were being taken to a local college campus.