The school year that just ended, the 2016-2017 school year was the safest on record in the history of New York City.

Mayor Bill de Blasio — along with school and police officials are celebrating. By the city's measure, schools are getting safer and safer -- which they say means students are in a better position to grow.

"You can't learn if you aren't in a safe environment," de Blasio said.

But the city has a problem. It's claim that violence in schools is declining is directly contradicted by data the state of New York collects.

"It's both misleading and irresponsible for the mayor to claim this is the safest school year on record," said Jeremiah Kittredge, CEO of Families for Excellent Schools.

Kittredge runs a pro-charter school group Families for Excellent Schools.

"All the data we look at shows that the schools are getting more and more violent," the CEO said.

The city and state have dramatically different approaches to tracking school safety. The state defines violence more broadly and reported nearly 17,000 violent episodes in city schools last year.

The city tracks murders, rapes, robberies, assaults, burglaries and theft in schools.

Mayor de Blasio says the city has reason to cheer: last year was the safest school year on record. However, critics are questioning the city's numbers and arguing they do not tell the full story. Our Grace Rauh has this report.

"If my kids were in first grade and they threw an empty milk carton or were on the receiving end, there is no way in the world I would consider that a violent incident," de Blasio said.

City officials say the milk carton example is a real one, and was counted as a violent confrontation by the state.

"We believe in the NYPD's numbers," the mayor said. "The State of New York is going to have its own standards, that's great."

The city is not rejecting all state data tracking violence in city schools. In fact, there is one measurement in particular that the mayor and other officials are embracing.

The state says the number of city schools it deems persistently dangerous has shrunk to just two.