Major crimes in New York City public schools are on the decline, according to data touted Tuesday by Mayor Bill de Blasio and NYPD officials.

De Blasio, speaking at a Brooklyn middle school, cited NYPD data that shows the number of crimes dropped by 5 percent in 2016-17 to 503 incidents compared with 532 in the previous school year.

De Blasio noted that the data shows an 18 percent reduction in crime since 2014-15 — his first full school year in office.

“Every young person who feels safe will be able to realize their potential,” de Blasio said at a news conference, where he was joined by schools Chancellor Carmen Fariña and NYPD Commissioner James O’Neill.

The city also has seen a decline in the number of schools on the state’s “persistently dangerous” list, de Blasio said. Last school year two schools were on the list, compared with 27 during the 2015-16 school year.

However, the number of weapons seized on school property increased from 1,073 during the 2015-16 school year to 1,429 this past school year, according to the NYPD’s data.

Families for Excellent Schools, a pro-charter-school advocacy group, took aim at the city’s figures, saying data collected by the New York State Education Department shows more crime. For example, during the 2015-16 school year, 16,851 violent incidents were reported, compared with 532 documented by the NYPD that year, the state said.

advertisement | advertise on newsday

De Blasio and city education officials said the discrepancy was due in part to differences in how the city and state define major crimes. The NYPD counts seven categories of crime — murder, rape, robbery, assault, burglary, grand larceny and auto theft. The state tracks 22 categories, including alcohol and drug possession, and bullying.

“We believe in the NYPD’s numbers,” de Blasio said when asked about the disparity.

Tuesday’s event was held at MS 88, which Fariña cited as a model school for employing several strategies aimed at reducing violence and conflicts among students. The school keeps a “comfort dog,” on campus during school hours to help students cope with stress, and organizes class discussions on conflict resolution.

De Blasio credited the crime reduction in part to policies put in place by former Mayor Michael Bloomberg. He also said the city since has committed $47 million to bolster mental health programs at schools, and to increase crisis intervention training for school workers.