TALLAHASSEE, Fla. — Florida became the first state with a law that spells out that prosecutors, and not defendants, have the burden of proof in pretrial “stand your ground” hearings when Republican Gov. Rick Scott signed a bill Friday.

The measure was among 16 bills that Scott signed, including a bill that gives students and school employees a broader right to express their religious viewpoint in schools.

The “stand your ground” bill was fought by prosecutors who say it will make their job more difficult to convict people who commit acts of violence and claim self-defense.

The Florida Supreme Court ruled in 2015 that defendants have to prove in pretrial hearings that they were defending themselves in order to avoid prosecution on charges for a violent act.

That led Republicans to seek to shift that burden. They argued that it protects a defendant’s constitutional right that presumes they are innocent until proven guilty. But opponents said it will embolden people to shoot to kill, and then claim self-defense knowing that the only witness against them can no longer testify.

Only four of the other 21 states with “stand your ground” laws mention burden of proof — Alabama, Colorado, Georgia and South Carolina — and all place it on defendants.

Many states have long invoked “the castle doctrine,” allowing people to use deadly force to defend themselves in their own homes.

Florida changed that in 2005, so that even outside a home, a person has no duty to retreat and can “stand his or her ground” anywhere they are legally allowed to be. Other states followed suit, and “stand your ground” defenses became much more common in pre-trial immunity hearings and during trials.

The 2012 killing of unarmed teenager Trayvon Martin by neighborhood watch volunteer George Zimmerman opened a debate about the limits of self-defense, and it hasn’t let up since Zimmerman was acquitted of second-degree murder after jurors received instructions on Florida’s “stand your ground” law.