The first photo of the 8-year-old boy shot dead by his teacher's estranged husband in California has been released, as details of the killer's dark past were revealed.

Jonathan Martinez was standing behind Karen Smith, 53, in her special-needs classroom at North Park Elementary School in San Bernardino on Monday morning when Cedric Anderson shot them dead.

Anderson, 53, fatally turned the gun on himself in the horrific murder-suicide, while a 9-year-old boy shot during the attack is recovering in hospital.

Betty Rodriguez, right, comforts her granddaughter Giselle during a prayer service held to honor the shooting victims at North Park Elementary School. Photo / AP
Betty Rodriguez, right, comforts her granddaughter Giselle during a prayer service held to honor the shooting victims at North Park Elementary School. Photo / AP

Jonathan's heartbroken cousin, Brianna Lopez, said she set up a GoFundMe page "to help Jonathan's family in this time of need".

Advertisement

It comes as details of Anderson's abusive history emerged, with his mother-in-law describing him as a "wolf in sheep's clothing".

"As soon as they married, he turned on her. The real Cedric came out," Irma Skyes, 80, told New York Daily News.

"He told her he would throw her out the window. She was shocked, like 'What happened?' He was so kind to her while they were dating. She had no idea."

Irma Skyes said she heard whispers of Anderson's dark side during the four years he dated her daughter.

Cedric Anderson (right) threatened his estranged wife, Karen Elaine Smith (left), after she had moved out. Photo / Facebook

The couple married in January, but separated in the middle of March when Smith moved out of their home and stayed with family.

San Bernardino police chief Jarrod Burguan said on Tuesday that Anderson threatened Smith when she moved out and accused her of infidelity in the first month of their marriage.

Smith's loved ones told investigators that she had said she was concerned about her husband's odd behaviour and that he had made threats against her, but not to shoot her.

Chief Burguan also said Anderson had four arrests in 20 years, but none of the cases ended in a conviction.

He said Anderson had faced a weapons charge, and those involving domestic violence and theft from 1982 to 2013. He said Anderson wasn't employed but previously had work as a maintenance worker and a pastor.

The police chief also said a note believed to be from Anderson had been found that talked about needing closure and feeling disrespected.

Cedric Anderson murdered his estranged wife, Karen Elaine Smith, in her classroom. Photos / AP
Cedric Anderson murdered his estranged wife, Karen Elaine Smith, in her classroom. Photos / AP

Counsellors have been made available at North Park Elementary after Anderson walked into the classroom with a concealed handgun and opened fire.

Mrs Sykes said her daughter had taught Sunday school for years before joining North Park School.

"She was a wonderful, God-fearing woman," she said. "But the Bible says, 'Thou shalt not kill.' So I can imagine where he [Anderson] is now."