Family members who believe a loved one poses a danger to themselves or others will be able to ask police to seek a temporary “gun violence” restraining order from a judge beginning Jan. 1. The order would allow police to seize the person’s guns for 21 days.

State lawmakers approved the legislation (AB1014) and Gov. Jerry Brown signed it into law after a 2014 mass shooting in Isla Vista, near the University of California, Santa Barbara, in which six people were killed and 14 injured. Before the shootings, sheriff’s deputies had visited the shooter, Elliot Rodger, after his parents raised concerns about his mental health and online rants against women.

But deputies concluded Rodger, 22, was not a risk. They decided they had no basis to search his apartment, where he had amassed guns, ammunition and knives.

Under the new law, a restraining order could be issued without prior knowledge of the person. In other words, a judge could issue the order without ever hearing from the person in question, if there are reasonable grounds to believe the person is a threat based on accounts from the family and police.

“The law gives us a vehicle to cause the person to surrender their weapons, to have a time out, if you will,” said Los Angeles Police Department Assistant Chief Michael Moore. “It allows further examination of the person’s mental state.”

After three weeks, the person can challenge the judge’s decision.

“It’s a short duration and it allows for due process,” Moore said.

California law already bans people from possessing guns if they’ve committed a violent crime or were involuntarily committed to a mental health facility. Police may also seize guns if a licensed therapist notifies them an individual is a risk to their own safety or the safety of others.

Moore said the new law is similar to seeking a domestic violence restraining order — no conviction is necessary.

“It's an opportunity for mental health professionals to provide an analysis of a person’s mental state,” Moore said. He did not anticipate “tremendous” use of the new law by police.

Gun-owner-rights groups opposed the law, arguing it could infringe on a person’s Second Amendment right to possess a gun.

“We don’t need another law to solve this problem,” Sam Paredes, executive director of Gun Owners of California, told the Associated Press.

“We think this just misses the mark and may create a situation where law-abiding gun owners are put in jeopardy.”