The lawsuit accuses Mayor Bill de Blasio’s education department of failing to keep children safe in schools. De Blasio is shown here in a January photo. (Mike Segar/Reuters)

Ten parents backed by a powerful charter-school advocacy group have sued New York City schools, alleging that the nation’s largest school system has failed to address escalating levels of violence inside its buildings and keep children safe.

Between the 2013-2014 and 2014-2015 school years, the number of violent incidents inside city schools rose 23 percent, according to the complaint. Forcible sex offenses rose 90 percent and assaults resulting in serious physical injury rose by 48 percent.

“The violence knows few boundaries, except that, on average, white and Asian students encounter far fewer incidents of school violence than black and Hispanic students,” says the complaint, filed Wednesday in federal district court.

Students with disabilities, LGBT students and very young students also bear the brunt of the problem disproportionately, the complaint says.

In a statement, Mayor Bill de Blasio (D) challenged the claim that violence is on the rise in city schools. “Major crime” in schools is down 14 percent this year to date, he said.

“I was a public school parent as recently as last June, and we never want to see a weapon in schools. I view each incidence as obviously troubling,” de Blasio said. “We absolutely have more work to do, but school safety is showing us consistently that they can and will continue to drive down crime in the schools, and keep all students and staff safe.”

The lawsuit alleges that the violence in New York City’s schools violates children’s constitutional rights and deprives them of their right to a safe education, which is guaranteed by state law.

Among the plaintiffs is Families for Excellent Schools, a pro-charter school advocacy group that has been a powerful lobbying force in Albany and a fierce critic of de Blasio and the chancellor of schools, Carmen Farina. The group has held multiple news conferences in recent months to highlight incidents of violence and weapons in the city’s schools.

In the last month, four students have been caught with loaded guns inside city schools, according to the city’s NBC television affiliate — including earlier this week when a 13-year-old boy threatened a 12-year-old girl with a loaded firearm inside an Upper East Side school.

The lawsuit alleges that school officials under-report school-violence incidents, citing a 2015 audit by the state comptroller that examined 10 public schools and found that nearly one-third of violent incidents had not been reported as required.

The plaintiffs, hoping to turn their complaint into a class-action lawsuit, are suing on behalf of every New York City public school student, now and in the future, who have been the victims of violence in school, “including assault, menacing, threats, intimidation and bullying by fellow students or employees” of the school system.