Still, the approbation for the bill was not universal. After weeks of hard-fought negotiations, the resulting bill left some who had sought the law disappointed in its many subsections and stipulations.

“This is real simple, and we made it complicated,” State Senator Kevin S. Parker of Brooklyn said, adding that this pattern of behavior was all too common in Albany. The result, he said during remarks on the floor during the bill’s passage on Sunday night, was a law that was “half a loaf.”

Mr. Parker, a Democrat, added: “All we had to simply do is say that we’re going to take 16- and 17-year-olds and we’re going to treat them just like 15-year-olds. That’s all we had to do, right? All we had to do. And we messed that up.”

Some sections of the new law are simple: 16- and 17-year-olds accused of misdemeanors — who make up the vast majority of juveniles arrested — would have their cases handled in Family Court. The picture gets more complicated, however, with nonviolent felony cases, which would still start in Criminal Court, albeit in a new section known as “youth part” and in front of judges trained in Family Court law.

Once there, the 16- and 17-year-olds would be automatically sent to Family Court after 30 days unless a district attorney proved “extraordinary circumstances,” a term that is undefined in the law. Those arrested in violent felony cases — which make up about 1 percent of the more than 20,000 juvenile charges in New York per year — could also be diverted from youth part if they pass a three-part test: whether the victim sustained significant physical injury, whether the accused used a weapon, and whether the perpetrator engaged in criminal sexual conduct.