Third-grader Jeremy Muschell was returning to his classroom after using the restroom when he heard the first of four loud booms.

“They were really, really loud, and he heard people yelling, ‘No, don’t!’ ” said his mother, Jane Muschell. “He told me he heard [the shooter] reload the gun — cocking the gun.”

And so the nightmare began on Monday morning at North Park Elementary School in San Bernardino, where Cedric Anderson, 53, gunned down his wife, teacher Karen Smith, and killed 8-year-old Jonathan Martinez. Anderson also wounded a 9-year-old child before turning the gun on himself.

On Tuesday, the community was trying to regroup after its second high-profile shooting in only 16 months. In December 2015, 14 people were killed and 22 others were wounded when terrorists opened fire at the Inland Regional Center.

In a news conference Tuesday, San Bernardino Police Chief Jarrod Burguan said Anderson and Smith had been in a relationship for about four years and separated soon after marrying in late January. The police chief said it appeared that Anderson had been attempting to contact Smith and persuade her to return home, but she was resistant.

People close to Smith, 53, said “she was concerned about his behavior, and that he had made some threats toward her,” Burguan told reporters, noting that Anderson had not specifically threatened to shoot the woman. “We were also told from the family that she didn’t necessarily take those threats seriously.”

No one at the school where Smith was a special-education teacher knew about the issues, Burguan said, adding: “She effectively kept her private life private.”

Anderson stopped by the school office Monday morning and told administrators he needed to drop something off for his wife, Burguan said.

Smith, a special-education instructor, taught in a part of school where the classrooms are separated by cubicle partitions instead of walls. That day, she was there with 15 students and two aides.

Brianna Alcazar, 7, was one of those students in Smith’s classroom. She said “the bad guy” didn’t say anything before he started shooting.

“I heard him load a gun,” Brianna said, speaking softly from the back seat of the car in the parking lot of a middle school where counselors were seeing families. “And then I saw his gun was black and his jacket was black.”

In the classroom next door, third-grader Jeremy said he heard Anderson’s gun go off.

As the shots rang out, his teacher quickly led the class out an emergency door to a playground on the far end of campus, where they waited for police.

“It happened so quickly; he said he was scared and wanted to cry,” Jeremy’s mother said.

Kerrie Oestreich came with her adult daughter Emily Oestreich. They are recreational aides who interact with students at recess and lunchtime, and were in their workroom with another woman during the shooting. Kerrie Oestreich said a maintenance crew happened to be on the grounds making repairs.

“It was like, ‘What the hell are they doing?’ ” she said, thinking the crew was the source of the noise. “And then when the second shot went off, that’s when the three of us looked at each other: those are gunshots.”

Kerrie said she left the room and saw some children in the hallway; she ushered them into a bathroom.

“I told them not to open the door,” she said.

In Smith’s classroom, two children had been shot. Student Benjamin Enriquez Jr. told his parents that he’d seen his friend — the 9-year-old boy who was injured — bleeding from his abdomen.

“He’s a special-needs kid and I don’t know if his mind actually retains all that, like if he really — what his mind really retained,” Benjamin Enriquez said of his son, who hid his face with a ball cap as his dad spoke outside the grief-counseling center that had been set up at the middle school. “I don’t think he really understands the whole picture of everything. But that’s why we’re here.”

The name of the injured child has not been released. Officials say he is in stable condition at a hospital. Jonathan was flown to a hospital, where he died of his wounds.

Kerrie Oestreich, who greets children each morning as they exit the school bus, said that she was the first adult Jonathan saw every morning when he came to school. She described him as a smiling and “happy-go-lucky” child.

“He was always happy, even when he was sick,” she said through tears.

“Sometimes he’d get off the bus and tell me, ‘Miss O, I think today my foot’s going to hurt,’” she remembered with a chuckle. “I’d be like, ‘Okay Jonathan. I’ll check on you later.’­ ” And he’d just bounce right on up with the rest of the kids.”

Students remembered Smith affectionately. Clutching a teddy bear, Brianna said that she loved her teacher.

“I miss her — I want her to come back,” Brianna said, adding that Smith taught her how to read and do subtraction. “She’s in heaven.”

Lindsey Bever in Washington contributed to this report.