A New York City law that forbids police from using chokeholds or sitting, kneeling, or standing on someone's torso during an arrest was upheld Monday by the state's highest court.

The law, passed after the death of George Floyd, had been challenged by police unions that said the new rules about compressing a person's torso were vague and would lead to too much second-guessing of officers involved in physical struggles.

The New York Court of Appeals, in a unanimous decision, ruled that the law's language is clear enough.

“We recognize that police officers are called upon to respond to dangerous and volatile situations requiring real-time assessment of the level of force necessary to safeguard the public and ensure officer safety,” the court wrote.

However, it noted that for officers to be found criminally liable under the law, they had to apply the banned force voluntarily “not accidentally,” and that “such conduct must fall outside the parameters of justifiable use of physical force.”

The court also ruled that it does not conflict with an existing state law banning police chokeholds.

The city’s law was enacted as governments across the country prohibited or severely limited the use of chokeholds or similar restraints by police following Floyd’s death in 2020, which occurred as a Minneapolis police officer kneeled on his neck for several minutes.

The New York Police Department has long barred its officers from using chokeholds to subdue people. New York state has a law banning police chokeholds that was named after Eric Garner, who died after a New York City officer placed him in a chokehold in 2014.

Besides banning chokeholds, city law also bars police from restraining someone by "sitting, kneeling, or standing on the chest or back in a manner that compresses the diaphragm.”

The Police Benevolent Association of the City of New York, along with other law enforcement unions, sued the city over the law's rules about putting pressure on a person's torso, arguing that it is vague as to what officers are allowed to do during an arrest. In a statement, John Nuthall, a spokesman for the Police Benevolent Association of the City of New York, said the ruling will provide clarity to officers.

"While this is not the outcome we had hoped for, the Court’s decision is a victory insofar that it will provide our officers with greater certainty when it comes to the statute, because under this Court’s decision, it must be proven at a minimum that an officer’s action in fact ‘impedes the person’s ability to breathe,’ was ‘not accidental,’ and was not a ‘justifiable use of physical force,’" Nuthall said.