SAN JOSE — A freshman boy at Overfelt High School was injured in a mid-morning stabbing behind the school’s gym Thursday, and two other teens have been detained in the attack, authorities said.

The stabbing was reported about 9 a.m. at the campus on Cunningham Avenue, and the victim was tended to by school staff until paramedics arrived to rush him to Regional Medical Center of San Jose. The injured boy is expected to survive.

Two teenage boys, a 10th-grader at the school and a student who officials said was not a student in the East Side Union High School District, were taken into police custody after first being corralled by staff responding to the melee, Superintendent Chris Funk said.

“The suspects were apprehended quickly,” Funk said. “They did not try to run away or put up a fight.”

San Jose police declined to release additional details about the attack, and said the motive and circumstances leading up to the stabbing remain under investigation.

The school was ordered to shelter in place while investigators examined the crime scene, but that was lifted within about an hour and Funk said school operations were not significantly disrupted.

“The community is safe, and and there are no outstanding suspects,” Lt. Steve Lagorio said.

Funk lauded the swift actions by campus faculty and staff to tend to the victim and ensure the suspects did not escape.

“I appreciate the response by the staff. They were able to get kids into their classrooms, and then apprehended the suspects until police got there.”

Several students said the victim was stabbed at least once in the abdomen. Students also sent out photos and videos of the stabbing aftermath via Snapchat and other social-media platforms, some of which were viewed by this news organization to confirm the nature and location of the attack.

Funk said the on-campus stabbing was an anomaly, calling Overfelt a “safe haven” for the surrounding neighborhoods that draw some of the highest police-call volumes in the city. But he also noted that the campus’ open design, which he described as a welcoming feature of the grounds, necessitates vigilance to keep staff and students safe.

“It’s a gorgeous school, and we want it to be a jewel for the community,” he said. “We don’t want metal detectors. We don’t want the school to have the perception of a prison or army camp. But we have to be careful since there are lots of ways to enter the campus.”