A judge has temporarily blocked Los Angeles County George Gascón's efforts to do away with certain sentencing enhancements, after his own prosecutors sued him, claiming he was ignoring the law.

The directives forbade prosecutors from seeking longer sentences for repeat offenders under the state's Three Strikes Law, as well as in several other types of cases. The Association of Deputy District Attorneys for Los Angeles County (ADDA) brought a lawsuit against him, and Judge James Chalfant granted their request for a preliminary injunction, allowing certain sentencing enhancements to continue for the duration of the case.

LA DISTRICT ATTORNEY GASCON ANGERS CRIME VICTIMS, PROSECUTORS WITH SWEEPING POLICIES

"The District Attorney's disregard of the Three Strikes law 'plead and prove' requirement is unlawful, as is requiring deputy DA's to seek dismissal of pending sentencing enhancements without a lawful basis," Chalfant's Wednesday order said.

At the same time, Chalfant said that "the public interest strongly weighs" in favor of Gascon, and that the "injunction will not enjoin the District Attorney from preventing deputy district attorneys from charging sentencing enhancements in new cases where not required by the Three Strikes law."

The ADDA celebrated the ruling, which they said protects victims as well as communities with high crime rates.

LA COUNTY DA GASCON RIPPED OVER LACK OF SPECIAL CHARGES IN ALLEGED COP KILLER'S ROBBERY CASES

"The court ruled as we expected in holding that the district attorney cannot order his prosecutors to ignore laws that protect the public from repeat offenders," they said in a statement. They added that "this decision was based on what the law is and not what an officeholder thinks it should be."

Gascón has publicly defended his directives throughout this case.

"I never had any illusions as to the difficulty and challenges associated with reforming a dated institution steeped in systemic racism," Gascón said in a statement, according to The Associated Press. "My directives are a product of the will of the people, including survivors of crime, and a substantial body of research that shows this modern approach will advance community safety."

After the ADDA filed the lawsuit in December, Gascón explained his position, and why he believes they would be beneficial.

FACED WITH WORSENING BUDGET CRISIS, LA LOOKS TO DELAY PAYING ITS BILLS

"People must be held accountable, but we often put ppl in prison for extra years, increasing recidivism & creating more victims," Gascón tweeted Wednesday evening. "This is unsafe, unjust & wastes taxpayer $. Prosecutors enter an appearance 'for the people' & the decisions we make must be in the people's interest."

Gascon said he intends to appeal the decision but will abide by it in the meantime.

CLICK HERE TO GET THE FOX NEWS APP

A trial setting conference for the case is currently scheduled for April 8.

The Associated Press contributed to this report.