Supporters of gun control hold signs in front of supporters of gun rights during a demonstration by victims of gun violence in front of the Supreme Court as arguments begin in a major case on gun rights on November 3, 2021 in Washington, DC.Supporters of gun control hold signs in front of supporters of gun rights during a demonstration by victims of gun violence in front of the Supreme Court as arguments begin in a major case on gun rights on November 3, 2021 in Washington, DC.

The most significant federal gun restrictions in decades were passed on Friday after years of false starts and failed to tighten gun laws.

The bipartisan bill that took steps to restrict gun access for the youngest buyers and domestic violence offenders was passed by the House. School safety and mental health programs would be funded by the act.

Fourteen Republicans joined all the Democrats in approving it. The legislation will be signed by President Joe Biden.

The Democrats hoped the legislation would make it harder for people to get guns. A New York law that restricted the ability to carry a concealed weapon was struck down by the Supreme Court. Laws around the country are in jeopardy.

Democrats cheered the legislation's passage as a landmark event after they won support from Republicans including Senate Minority LeaderMitch McConnell, the Kentucky Republican who has long fought efforts to restrict gun ownership.

Biden said after the Senate approved the bill that bipartisan members of Congress came together to heed the call of families across the country. Families in Uvalde and Buffalo have been demanding action. We acted this evening.

Background checks for gun buyers under the age of 21 would be improved. After the Buffalo and Uvalde, Texas shootings, the ease of access to firearms for young adults came under increased scrutiny. The Democrats wanted to ban those types of weapons for young people.

The legislation seeks to close the boyfriend loophole and restrict gun ownership for domestic violence offenders who are not married to their partners. Grants would be set up for states to encourage red-flag laws, which allow police or relatives and acquaintances to petition courts to order the removal of a gun if the person is deemed dangerous.

School safety and mental health programs would be funded by it. Those issues, not the prevalence of firearms, have been argued to be the cause of the U.S. gun violence epidemic. Democrats have long complained about the under funding of mental health programs.

Speaker of the House Nancy Pelosi (D-CA) speaks at a rally with gun violence prevention organizations, gun violence survivors and hundreds of gun safety supporters demanding gun legislation, ouside the United States Capitol in Washington, June 8, 2022.

Nancy Pelosi, the speaker of the house, acted quickly to pass the legislation despite her concerns about its scope.

She said in a statement that the crisis requires urgent action. The Bipartisan Safer Communities Act will help protect our kids and save lives.

The proposal would have banned assault-style rifles for people under 21. It didn't have a chance of getting through the Senate, where Democrats need to win over 10 Republicans to break a legislative filibuster.

The talks were led by Murphy and Cornyn. Murphy was in the US House of Representatives when the Sandy Hook Elementary massacre took place.

McConnell was one of fifteen Republicans to vote for the bill. The legislation was framed as a middle ground between protecting schools and gun rights.

The legislation that we are considering would make our communities and schools safer without placing any blame on the Second Amendment. The key provisions are popular with the American people.

You can also subscribe to CNBC on the internet.