Minnesota Democrats reached a deal Wednesday on two long-sought gun safety measures, one of the trickiest issues for the narrow DFL majority in the Senate.

New gun restrictions easily passed the House in recent years but were blocked by Republicans when they controlled the Senate. Even with a 34-33 Senate DFL edge, it was unclear until Wednesday whether Democrats would agree on how far to go with new restrictions.

"In some states it seems the governors are only willing and interested in pursuing red flag laws after there's been a mass shooting in their community," said Sen. Ron Latz, DFL-St. Louis Park, who has been pushing for stricter gun laws at the Capitol for more than a decade. "We will not be waiting for that kind of a tragedy to happen."

Both provisions were endorsed by a joint House-Senate committee working to reconcile differences in a massive public safety bill, which still must return to both the House and Senate for final votes. Gov. Tim Walz already has indicated his support for new gun measures.

Gun rights groups and GOP legislative leaders said Democrats were inserting controversial measures into a budget bill with no opportunity for testimony from opponents. They encouraged rural DFL members to vote against the bills.

"These gun control measures violate the Second Amendment rights of law-abiding gun owners, and are being forced into a budget bill to avoid an up or down vote because Democrats know these bills have bipartisan opposition and would not pass," Republican House Minority Leader Lisa Demuth said in a statement.

The gun provisions mostly mirror those that won approval of the Senate Judiciary Committee earlier this session.

One would allow law enforcement or family members to petition the court to take guns away from those who are deemed dangerous to themselves or others. The other would close the so-called gun-show loophole by expanding background checks for private sales or transfers of pistols and semiautomatic military-style assault weapons.

"This is a long time coming and it should have been done a long time ago," said Sen. Bonnie Westlin, DFL-Plymouth. She acknowledged that the changes won't end gun violence, but she believes they will help. "This is about harm reduction. It is about risk reduction."

Latz said he's been looking for the "sweet spot" in rounding up votes to pass new gun measures. "I think we may have done it this year," he said.

He noted that 60% of the gun deaths in greater Minnesota are by suicide, not homicide, and that sometimes there are signs, or "red flags."

"We will now provide a tool to law enforcement that will be preventative as opposed to reactive," said Rep. Cedrick Frazier, DFL-New Hope.

Legislators said recent mass shootings in other states and the recent deaths of law enforcement officers in Minnesota and Wisconsin added urgency to their negotiations.

The proposal also increased from 10 to 20 years the penalty for possessing a machine gun, trigger activator or conversion kit that can turn a semiautomatic firearm into an automatic.

House and Senate negotiators also agreed to substantially limit the use of no-knock search warrants by law enforcement in Minnesota. The change came together earlier this week at the urging of the family of 22-year-old Amir Locke, who was killed during a no-knock search in Minneapolis last year.

The public safety package changes the requirement of a unanimous vote by the Board of Pardons on clemency requests. The board includes the governor, attorney general and state Supreme Court chief justice. Currently, a successful clemency vote must be unanimous. Now only two votes would be needed for clemency, provided one of them is the governor.

The bill also directs almost $1 million to establish a Clemency Review Commission that will review and research each petition from inmates and make a nonbinding recommendation to the Board of Pardons on whether to grant the requests.

Judges and administrative staff will get pay raises each of the next two years under the public safety proposal. The biggest cash infusion goes to the state public defender system, which would receive a roughly 50% increase in each of the next two years toward hiring more lawyers and boosting salaries.

The bill also would establish in the Department of Public Safety an Office of Restorative Practices at a cost of $500,000 a year. The aim of the office is to foster respect and healing between communities harmed by crime and those who committed it.

Democratic legislators in the House were celebratory Wednesday about the details in the public safety package, but they initially went further in their gun control measures.

The House proposed tougher penalties for violating the background check provision and wanted respondents to wait 12 months before they could appeal their protective order in the red flag law. The agreement in the public safety bill allows someone to appeal after six months.

"These can't be the only things we do, these conversations need to continue and there are more things we can do across the board," said Rep. Jamie Becker-Finn, DFL-Roseville, who chairs a judiciary committee in the House. "I look forward to continuing this work, but this is a good day."