The city of Los Angeles has been barred from enforcing the vast majority of its gang injunctions, which applied restrictions on gang associations that authorities have long credited with reducing crime.

The ruling Thursday by U.S. District Judge Virginia A. Phillips, an appointee of former President Bill Clinton, agreed with the American Civil Liberties Union that the injunctions were likely to be unconstitutionally broad, and affect people who did not have adequate opportunity to challenge them in court.

The gang injunctions are civil court orders that have applied to nearly 9,000 people and 79 gang sets since 2000, the Los Angeles Times reported.

The orders can effectively prevent individuals from legally associating with people in gang-ridden neighborhoods or networks.

WHAT IS MS-13, THE VIOLENT GANG TRUMP PROMISES TO TARGET?

The ACLU challenged the constitutionality of the injunctions because the city could obtain them against gangs, rather than individuals.

"This ruling marks the end of gang injunctions as they worked in the city of Los Angeles." — ACLU attorney Peter Bibring

That meant someone could become the subject of an injunction without ever being specifically named in a court document, or given enough notice to object.

"The court clearly recognizes the way the city of Los Angeles has been enforcing gang injunctions over decades violates due process in a way that makes it likely they will place people on gang injunctions who may not be gang members," ACLU attorney Peter Bibring said Thursday, according to the Los Angeles Times. "This ruling marks the end of gang injunctions as they worked in the city of Los Angeles."

A handful of the gang injunctions that did name individuals will reportedly remain in effect.

A Los Angeles police union condemned the ruling in a statement.

"Appropriately applied, gang injunctions are a valuable law enforcement tool intended to improve the safety of Los Angeles neighborhoods and stem the tide of drug dealing, assaults, and other violent crimes associated with gangs," the Los Angeles Police Protective League said.

"It's unfortunate that a judge would eliminate this important crime fighting tool instead of working to resolve any issues with its application," the union's statement added. "We urge the city to appeal this shortsighted ruling."

The ACLU had won a ruling last year for an Echo Park resident who alleged that he was unconstitutionally swept up in a gang injunction.

Thursday's ruling broadens the effect of that decision to those subject to gang injunctions prior to this year, when the city modified its gang injunction procedures.