The fatal stabbing at a Bronx school Wednesday comes amid continuing debate over school safety and the use of metal detectors in schools — but also as serious crimes in schools are at near-record lows.

Details about the incident at the Urban Assembly School for Wildlife Conservation are still coming in, but city officials have confirmed that two teenage students were stabbed during a history class, one fatally, by a classmate wielding a switchblade.

The incident is extremely rare: One student has not killed another inside a school for more than two decades, officials said. And though Wednesday’s events have put some families on edge, they come in the context of a wider downturn in crime inside schools and citywide.

The number of major crimes committed in schools — from murder to grand larceny — are at their lowest levels since the city began keeping track in 1998. Arrests, summonses, and suspensions have also fallen in recent years.

Less than two months ago, Mayor Bill de Blasio highlighted those trends at a press conference declaring last school year “the safest year on record.” At a briefing Wednesday, he noted that it had been “many, many years” since a student was killed inside a school.

The last time a student was killed at the hands of another student inside a school building appeared to be in 1993, when a 15-year-old student fatally stabbed another 15-year-old boy in the crowded hallway of a Manhattan junior high school. (In 2014, a 14-year-old boy stabbed another boy to death outside I.S. 117 in the Bronx.)

Still, the mayor’s critics have painted a different picture of overall school safety, relying on state data and other statistics that show more weapons are being recovered from city schools. Last school year, 1,429 weapons were recovered, according to police data, up from 1,073 the year before. De Blasio said last month that the increase could indicate greater vigilance from school personnel and police as opposed to a less safe environment.

Wednesday’s episode may also complicate the debate about the city’s deployment of metal detectors in school buildings. The building did not have a metal detector, and a police official said in a briefing that there was “no question” the knife used in the attack would have been caught during screening.

After rushing back to school to pick up their children, parents at the School for Wildlife Conservation reportedly began calling for the city to set up metal detectors. De Blasio said temporary metal detectors would be brought into the school on Thursday.

Police Chief Joanne Jaffe, who oversees the community affairs bureau, said it had previously been determined that the school did not require metal detectors, but now, “We’ll review that and take a look at that.”

Some advocates have argued metal detectors make students feel like criminals and “normalized the idea of getting shot or stabbed” as one student put it. Black and Hispanic students are more likely to have to pass through metal detectors, a WNYC analysis found.

Eighty-eight buildings currently have metal detectors, education department spokeswoman Toya Holness said. The city conducts annual reviews to determine if scanners are needed, and principals can also request that they be added or removed.

Last year, schools Chancellor Carmen Fariña acknowledged advocates’ concerns about the use of scanners, but said they had to be weighed against students’ safety.

“You want to make sure that when you remove something,” she said, “that the school stays as safe.”

Correction: Based on information from city officials, an earlier version of this story cited a fatal stabbing at a Brooklyn high school in 1992 as the last time one student killed another inside a New York City. However, as the story now notes, another student was fatally stabbed inside a school later that academic year, in 1993.