BOSTON -- Massachusetts on Tuesday became the 11th state to adopt a "red flag" law, allowing someone's gun to be confiscated if they pose a risk of harming themselves or someone else.

Gov. Charlie Baker signed a law establishing a process for judges to issue extreme risk protection orders.

Massachusetts already has some of the nation's strictest gun laws. Baker, a Republican, said Massachusetts is now the only state to have both banned bump stocks, which are devices that make a gun shoot faster, and passed a red flag bill.

"Even in a state like ours, which has made tremendous progress on this issue, when there's more to do, we do it," Baker said.

Under the new law, which goes into effect in 45 days, if a family or household member believes someone poses a risk to themselves or someone else, they can petition a District Court judge to immediately suspend that person's gun license and temporarily confiscate their weapons. Within 10 days, the judge will hold a hearing, and the person will have a chance to argue whether the protective order should be extended for up to a year.

The ruling could be appealed and could be modified based on a request by either party. There are penalties for violating an extreme risk protective order and for filing false statements to harass someone.

Supporters of the new law say it will save lives by preventing someone in crisis from committing suicide or from killing others.

"This law is incredibly important in providing families with a really meaningful tool to help intervene before a tragedy occurs," said Janet Goldenberg, chairwoman of the Massachusetts Coalition to Prevent Gun Violence.

Massachusetts already has a unique provision in its laws giving police chiefs authority to deny a gun license to someone the chief deems unsuitable.

Steven Wojnar, the Dudley police chief and president of Massachusetts Chiefs of Police Association, said the extreme risk protection order is "another tool in the toolbox" to improve public safety by letting families go straight to the courts. "Who knows an individual better than their own family?" Wojnar said.

Massachusetts already passed a major overhaul of its gun laws in 2014, with provisions focused on school safety, mental health, background checks and enhanced criminal penalties for gun crimes.

The latest bill, sponsored by Rep. Marjorie Decker, D-Cambridge, gained momentum in the Legislature during a national push for stronger gun control laws after a school shooting in Parkland, Florida.

Florida, Vermont, Rhode Island, Maryland and New Jersey all passed red flag bills after the Parkland shooting.

House Speaker Robert DeLeo, D-Winthrop, credited the students for bringing gun control to the forefront of the legislative agenda. Asked about any next steps, he said he is not sure what else there is for Massachusetts to do on gun safety. "What we have done is hopefully taken a huge step in making Massachusetts the safest place in the world to live," DeLeo said.

But DeLeo cautioned that unless Congress passes gun control laws nationally, guns will continue to come across state lines. "For us to really have the strong gun legislation that is necessary, it really has to come from Washington," DeLeo said. "Until you get legislation across the country so every state plays by the same rules, I'm not sure what we can do."

Massachusetts' gun rights lobby had opposed the bill, saying it does nothing to address someone who has a mental illness, but merely confiscates a person's weapons and sends them home.

Under the law, the Department of Mental Health will create a pamphlet with information about mental health resources to provide to the person who petitions for an order and the subject of the order.

The new law also regulates stun guns, after the Supreme Judicial Court struck down the state's ban on stun guns.

The bill passed the House 131-15 and the Senate 36-1.

"Hopefully, because of this bill, we will prevent situations like Parkland, like Sandy Hook, from ever happening on our state," said Cindy Rowe, executive director of the Jewish Alliance for Law and Social Action, referring to two school shootings. "This new law will protect our school children, it will protect people who are at risk of committing suicide."