TAMPA, Fla. (Reuters) - A Florida state court judge ruled on Monday that recent changes to the state’s “stand your ground” law are unconstitutional, finding that legislators overstepped when making it easier for defendants to argue self-defense to obtain immunity for violent acts.

Miami-Dade Circuit Court Judge Milton Hirsch said courts, not lawmakers, should set the process by which defendants can claim they were protecting themselves with an act of violence, according to the ruling posted online by the Miami Herald.

The revision shifted the burden of proof during pretrial hearings to prosecutors, rather than defendants, to show whether force was used lawfully. Supporters saw the changes backed by the National Rifle Association, the powerful U.S. gun lobby, as bolstering civilians’ rights to protect themselves.

Advocates predicted the ruling would be reversed on appeal.

“It is the role of the legislature to write the laws that govern how Floridians may exercise their statutory and constitutional rights,” Richard Corcoran, the Republican speaker of the House of Representatives, said in a statement. “The Florida House will continue to stand with ordinary citizens who exercise their right to self-defense.”

Florida’s “stand your ground” law, passed in 2005, received wide scrutiny and inspired similar laws in other states. It removed the legal responsibility to retreat from a dangerous situation and allowed the use of deadly force when a person felt greatly threatened.

This spring’s changes were adopted over outcry that gun owners could be emboldened to shoot first.

Critics cited the 2012 death of unarmed black teenager Trayvon Martin in the Orlando area, which spurred national protests and the Black Lives Matter movement. The neighborhood watchman who killed him, George Zimmerman, was acquitted of murder after the law was included in jury instructions.

Monday’s ruling in Miami circuit court is not binding on other state trial courts, the Miami Herald reported.