A gunman's "relatively short" marriage and his alleged history of crime and drug use preceded Monday's killing and suicide at a California grade school where three people died, according to police.

Cedric Anderson, of Riverside, California, walked into a special-needs classroom at North Park Elementary School in San Bernardino and opened fire on his estranged wife, Karen Elaine Smith, "without saying anything," before turning the gun himself, San Bernardino Police Chief Jarrod Burguan said.

Stay with WSBTV.com and Channel 2 Action News as this story develops.

Anderson and Smith, both 53, were found dead in the classroom after the incident, which occurred at around 10:30 a.m. local time, Burguan said.

Two male students, who were injured as Anderson fired at his wife, were taken to a hospital for treatment, police said.

One on them, Jonathan Martinez, 8, died later from his injuries after being airlifted to Loma Linda University Medical Center, Burguan said. The other student, a 9-year-old, is hospitalized in stable condition, police said.

A GoFundMe page has been created for Jonathan Martinez's family.

The gunman's history

Anderson had a criminal history that included weapons charges, drug charges and accusations of domestic violence, Burguan said.

Burguan said they separated about a month ago after being married for just a few months.

It wasn't long before Anderson began to show a different side to him, Smith's mother, Irma Sykes, told ABC Los Angeles station KABC-TV.

TRENDING STORIES:

"We thought he was a fine person," Sykes said. "Until they were married and then he showed the other side of him. Which we had never seen before. We were shocked.He began to pick on my daughter and talk down to her. And they had dated for four years. And after about three weeks, my husband and I decided, you need to get away from him. He is not the kind of person you thought he was."

About a month ago the couple separated. Anderson kept trying to reach out to his wife, but she wasn't returning his calls, Sykes said.

Police said Anderson used a .357 revolver and reloaded at least once during the attack.

There was "no reason to believe" the students were specifically targeted in the shooting, Burguan said, adding that there were 15 students and two aides in the multigrade classroom at the time.

"No one has come forward to say they saw this coming," Burguan said Monday afternoon during a news conference.

How the gunman gained access

Anderson was a "known person" by school staff, and all the precautionary procedures were taken to confirm his identity when he arrived at the school, San Bernardino Unified School District Superintendent Dale Marsden said.

Capt. Ron Maass, who is leading the investigation for the San Bernardino Police Department, said the shooter entered the building on a visitor’s pass and signed in at the front office.

Anderson had told school personnel he was there to drop something off to his wife, which is "not uncommon," according to Burguan.

There is no indication that the gun was visible upon the suspect's arrival to the school, Maass said.

It is unclear how many shots were fired, he added.

Community reaction

Residents in the neighborhood held a candlelight vigil in outside of the school Monday evening.

Students, close in age to the special education students who were shot in the attack, told KABC-TV that Smith was a “good teacher.”

One girl described Smith as a “nice” teacher who would “help people that needed help.”