Gov. Jerry Brown (D) gave his signature to a popular bill backed by both sides of the debate that will help prevent unfair gun seizures and defend the rights of gun owners.

The law allows a person subject to a gun violence restraining order to transfer their firearms to a licensed dealer for safekeeping, rather than turn them in to police.

Backers of the measure, which passed both the Assembly and Senate in unanimous votes last month, contend its one of many tweaks needed to the controversial restraining order practice, which has been characterized as the “turn in your neighbor” law.

“Today, we witnessed a rare victory for gun owners across California,” said Assemblywoman Melissa A. Melendez, R-Lake Elsinore, the bill’s sponsor. “By allowing a trustworthy alternative for gun owners to maintain possession of their firearms, we are preventing any unjustified gun grab against those who may be unfairly targeted by bogus allegations.”

Melendez’s bill, AB 950, codifies an exemption to state’s new gun violence order restraining laws put into effect after a disturbed man attacked the campus of the University of California Santa Barbara in Isla Vista. Before the incident, parents of the suspect in the incident tried unsuccessfully to get authorities to take away his weapons.

Currently, that law requires an individual subject to an order to either sell their firearms or surrender them to police. The reform signed by Gov. Brown on Thursday allows gun owners to transfer their collection to a federal firearms license holder for the period of the restraining order so that they can easily retrieve them once the order has cleared.

The bill saw support from gun control organizations to include the Law Center to Prevent Gun Violence as well as Second Amendment groups the National Rifle Association, California Rifle and Pistol Association and Firearms Policy Coalition, even if the support was conditional.

Gun rights advocates argued that, in light of recent decisions by the U.S. Supreme Court handed down since California adopted its gun violence restraining order process, even a gun owner convicted of a felony still has the right to sell off their gun collection and state law should be modified to accept that.

Assembly Bill 950 will take effect Jan. 1, 2016