A judge in Florida ruled Monday that the state's updated "stand your ground" law, which required prosecutors to disprove a defendant's self-defense case at pretrial hearings, is unconstitutional, setting up a showdown that could make its way to the state's top court.

Miami-Dade Circuit Judge Milton Hirsch ruled that the amendment to the law allowed lawmakers to overstep their authority, adding that it should have been crafted by the Florida Supreme Court in the first place, The Miami Herald reported.

“As a matter of constitutional separation of powers, that procedure cannot be legislatively modified,” Hirsch wrote.

The Florida Supreme Court had ruled in 2015 to shift the burden to defendants, requiring them to prove in pretrial hearings that they were defending themselves in order to avoid prosecution on charges for a violent act.

Florida Gov. Rick Scott signed the amended legislation, backed by the National Rifle Association, into effect in June. Prosecutors were vehemently against the updated law because they believed it made it easier for defendants to get away from murder. Prosecutors also had to provide "clear and convincing" evidence that a defendant was not using the force as an act of self-defense.

FLORIDA SEES KILLINGS INCREASE AFTER PASSAGE OF 'STAND YOUR GROUND' GUN LAW, STUDY SAYS

The law was first passed in 2005 and it gave people the right to "shoot first" if they believed their lives were in danger at that moment.

"A person is justified in the use of deadly force and does not have a duty to retreat if: He or she reasonably believes that such force is necessary to prevent imminent death or great bodily harm to himself or herself," the Florida law states.

It also gave judges the right to dismiss charges against the defendant if they believed reasonable self-defense was used in the case.

In states without the "stand your ground law," people must retreat first before using force.

ACCUSED FLORIDA KIDNAPPER WAS ACTUALLY HELPING LOST CHILD, POLICE SAY

The controversial self-defense law came into the spotlight during George Zimmerman's case in 2012, when the neighborhood watchman shot and killed the unarmed teenager Trayvon Martin in Central Florida.

Zimmerman's attorney argued his client used force because he "reasonably" believed his life was in immediate danger.

A jury ultimately acquitted Zimmerman of second-degree murder.

The Associated Press contributed to this report.