AP

SACRAMENTO, California (AP) — California will become the first state that allows family members to ask a judge to remove firearms from a relative who appears to pose a threat, under legislation Gov. Jerry Brown said Tuesday he had signed.

The bill was proposed by several Democrats and responds to a deadly rampage in May near the University of California, Santa Barbara.

Relatives of the victims and other supporters of the bill said the parents of 22-year-old Elliot Rodger were thwarted in their attempts to seek help for their troubled son before the rampage.

Supporters had said such a measure could have prevented the attacks, winning out over critics who said it would erode gun rights.

"If both of these laws had been in place on May 23, things could have been very different," Rodger's father, Peter Rodger, said in a statement Tuesday night. "California, today, is a safer state because of this legislation. Let's hope other states follow."

Law enforcement authorities in Connecticut, Indiana and Texas can seek a judge's order allowing them to seize guns from people they deem to be a danger.

The new California law gives law enforcement the same option and extends it to family members.

It continues California's efforts to lead the nation in preventing firearm injury and death, said Amanda Wilcox, an advocate for the Brady Campaign to Prevent Gun Violence, whose daughter was a victim of gun violence.

The greatest effect might be in preventing suicides or intervening where there is a history of domestic violence, she said.

"It's hard to know how much it will be used or how much it will prevent," Wilcox said. "It only takes avoiding one loss for this to be worth it."

Lawmakers approved the bill by Democratic Assembly members Nancy Skinner of Berkeley and Das Williams of Santa Barbara amid pleas that they act after the May 23 attack in which six people were fatally stabbed or shot and 13 others wounded in the community of Isla Vista.

Relatives of the victims and other supporters of the bill said the parents of 22-year-old Elliot Rodger were thwarted in their attempts to seek help for their troubled son before the rampage.

Weeks earlier, his parents had his therapist contact Santa Barbara County mental health officials. Sheriff's deputies talked to Rodger but never entered his apartment or checked to see if he owned guns.

They decided he was not a threat to himself or others and took no further action.

Elliot Rodger later wrote that had deputies searched his room, they might have found guns that police said he used to shoot three people after stabbing to death three others. Rodger killed himself while being pursued by police.

Under the California bill, whoever seeks the restraining order would have to sign an affidavit under oath. If they lie, they could be charged with a misdemeanor.

A court hearing would be held within 14 days after the restraining order is granted to give the gun owner a chance to argue there is no danger.

Republican lawmakers and some Democrats voted against the measure, known as AB1014.

In Rodger's case, there is no evidence his parents or anyone treating him knew he had weapons. That prompted Democratic Sen. Hannah-Beth Jackson to introduce a related bill that would require law enforcement agencies to develop policies that encourage officers to search the state's database of gun purchases as part of routine welfare checks. That bill, SB505, also was signed by the governor.

Brown's signing of the bills "helped to honor the life of my son, Christopher, and so many others killed by senseless gun violence," said Richard Martinez, father of Isla Vista shooting victim Christopher Ross Michaels-Martinez and an advocate for the group Everytown for Gun Safety.

Currently in California, authorities can seize legally purchased guns only from people convicted of a felony or a violent misdemeanor, those subject to a domestic violence restraining order, or those who are determined to be mentally unstable.

The National Rifle Association and other gun-rights groups opposed the restraining order legislation.