The number of NYPD school safety agents working in city schools has fallen by roughly 1,000 over the last three years, according to a report published on Tuesday by the Independent Budget Office.

The report shows roughly 3,900 of the agents were employed as of late February. The NYPD reports the current number of school safety agents at roughly 4,100.

Those figures are down from roughly 5,050 in 2020, the year that “defund the police” protests in the aftermath of the police killing of George Floyd prompted changes to the NYPD's budget. That year, the City Council voted against hiring more than 1,000 officers slated to join the department, including hundreds headed for the school safety division.

The high rate of attrition comes as Mayor Eric Adams’ proposed budget seeks to eliminate hundreds of unfilled school safety agent jobs from the city’s payroll — even as shootings and stabbings outside school buildings continue to rattle communities citywide.

On Tuesday, a teenager was shot near Martin Luther King Jr. High School on the Upper West Side, prompting a brief shelter in place order at that school and nearby LaGuardia High School.

An education department spokesperson called the shooting an “offsite, non-school related incident.”

That shooting came just a day after a student in Queens was stabbed at a park across the street from his high school. And those are just the latest in a string of violent incidents outside schools.

Adams and Schools Chancellor David Banks have in recent months called for increasing security at schools by locking front doors and strengthening communication between principals and police commanders.

The budget office said the sharp decrease in school safety agents is the result of attrition, as well as the police budget cuts made following the 2020 protests.

Gregory Floyd, who heads the union representing school safety agents, said the rise in violence outside schools has been “predictable” as the number of safety agents has declined precipitously.

“We no longer have the school safety agents we need to safeguard us because we do not have the staffing,” he said. “The recruitment is down because of the salary and villainizing of school safety agents.”

Amaris Cockfield, a spokesperson for the mayor, said there are currently 250 school safety agents in training who are slated to begin in April.

“The safety of our students will always be a top priority for this administration,” said Cockfield. “As with any agency, we will work with them to evaluate their needs through the budget process once they fill all budgeted positions, but, in the meantime, we will continue to build on the productive steps we have taken thus far and invest in a holistic vision of public safety that keeps our youngest safe.”