"We have no reason to believe that the students were targeted, not that it makes it any better."
A spokesperson for the San Bernardino City Unified School District said the shooting occurred in a special education classroom, which, at the time, was filled with first- through third-grade students. Officials said the school, which enrolls about 530 children, will be closed for two days.
The two wounded students were listed in critical condition, Maass said, adding that police do not think the children were targets in the attack.
"The suspect had come to the classroom to visit the adult female," he said. "We think the two children were unfortunate recipients of injuries."
The relationship between the suspect and the victim is unclear, but authorities said the students who were wounded were not related to them.
Authorities said the suspect had gone to see the victim; there was no indication that the gun was visible when the suspect entered the classroom.
Earlier, San Bernardino Police Chief Jarrod Burguan said on Twitter that police officers were responding to the school after a shooting inside a classroom that he said was most likely a "murder-suicide".
"We think the suspect is down and there's no further threat," he wrote.
The police chief said at the time that there were four victims.
The two students were transported to a nearby hospital, he said. Other students were taken to Cajon High School for their safety and were being released to their parents.
US Secretary of Education Betsy DeVos called the shooting a "horrible act" and extended prayers to the victims and their families.
"As a mother and grandmother, today's senseless violence is a tragedy no parent should ever have to face," she said in a statement. "I ask everyone to join me in keeping all the victims and those impacted in your prayers."
The shooting comes 16 months after a terrorist attack left 14 people dead and 22 others wounded, when Syed Rizwan Farook and Tashfeen Malik, a married couple, entered a venue hosting a Christmas party for county public health workers and opened fire. The two were killed hours later in a shootout with San Bernardino police.
A school district spokeswoman said that the city's schools increased security measures after the 2015 terrorist attack.
"All our schools, especially post December 2, have tightened up security procedures," said Maria Garcia, the school district spokeswoman. "Once the school bell rings, the only entry point into a campus is the main school office, where visitors have to sign in and receive a visitor's pass."
After the shooting, school district Superintendent Dale Marsden said, "Our hearts are broken, as are everyone else's."
"This is a tragic event," he said during the news conference. "It's going to take time for our heads, our hearts, to heal — when you're going through this type of horrible event, we need each other to walk hand in hand to heal, to continue to press forward, to not allow what is tragic to halt our lives."
There have been 220 school shootings in the United States since 2013, according to Everytown for Gun Safety, a group that tracks gun violence in the United States. The group reported that, on an average day in the United States, seven children and teenagers ages 19 or under are killed with guns.
There were 48 school shootings in the United States in 2016, an average of just under one incident a week, according to statistics compiled by Everytown for Gun Safety. The shooting in San Bernardino is the 12th in 2017.
"Today, yet another elementary school community was shaken by gun violence," Shannon Watts, founder of Moms Demand Action for Gun Sense in America, said in a statement. "Our thoughts are with the students, faculty and families affected by the shooting. Educators should not have to fear being shot at work. Parents should not have to fear their children not returning home from school."
"There have been more than 200 school shootings in less than five years, and lockdown drills have become part of standard safety practice. There are solutions out there — too often we rely on thoughts and prayers to do the work our politicians refuse to do. Our volunteers and gun violence survivors will not rest until our leaders put our children's safety first and we change the culture of gun violence in this country."