The Senate advanced legislation aimed at preventing mass shootings through a key procedural hurdle Thursday, voting to end debate and move toward a final vote on a package that combines modest new firearms restrictions with $15 billion in mental health and school security funding.

The 65-34 vote represented an unlikely breakthrough in the emotionally charged and divisive issue of American gun laws, which have remained largely unchanged for more than 25 years, despite the nation being repeatedly scarred by mass shootings whose names have become etched in history — from Columbine and Virginia Tech to Sandy Hook and Parkland.

However, the May 24 killing of 19 students and two teachers inside a Uvalde, Texas, elementary school prompted renewed action, compelling a small group of senators to negotiate a narrow bipartisan package aimed at keeping guns out of the hands of dangerous potential killers while also beefing up the nation’s mental health-care capacity with billions of dollars in new funding.

On Thursday, the resulting Bipartisan Safer Communities Act received support from all 50 Democratic members and 15 Republicans, including Minority Leader Mitch McConnell (R-Ky.), who has previously opposed previous attempts to toughen gun laws in the aftermath of mass shootings.

President Biden, who called for far more stringent gun-control measures in a speech earlier this month, has indicated that he intends to sign the bill.

The true breakthrough, however, was Thursday’s Senate vote, which broke a de facto filibuster of gun-control legislation that had been in place since the mid-1990s, when bipartisan majorities passed the Brady Bill, which established the national background check system, a 10-year ban on assault weapons, and restrictions on gun sales to domestic violence offenders.

However, none of the measures included in the current bill go nearly as far. They are best described as minor expansions and adjustments to existing laws, such as closing the “boyfriend loophole,” a gap in the 1996 law intended to keep guns away from domestic violence offenders.

However, current law only prohibits the sale of weapons to misdemeanor domestic violence offenders who committed their crimes against a spouse or partner with whom they had lived or had a child. The Senate bill includes misdemeanors committed against people in a “current or recent former dating relationship” for the first time.

Another important provision establishes “enhanced” background checks for gun buyers under the age of 21, who will be subjected to a search of juvenile criminal and mental health records for the first time. Under the Senate bill, authorities would have up to 10 business days to review those records, though that provision is set to expire in 10 years, after which juvenile records would be routinely included in the federal instant background check database.

The bill also adds $750 million to an existing Justice Department grant program and, for the first time, allows it to fund state crisis intervention programs, such as “red flag” laws that allow authorities to temporarily remove guns from people who are deemed a danger to themselves or their communities. Other provisions create new federal gun trafficking offenses and clarify which gun sellers must obtain a federal firearms license and, as a result, conduct background checks on their customers.

The bill’s mental-health provisions would allow states to establish “community behavioral health centers,” expand in-school intervention programs, and expand access to telehealth services for those in mental health crisis, among other things. The $15 billion cost is offset by postponing a Trump administration regulation on Medicare drug costs.

The Senate vote came just hours after the Supreme Court, in a 6-3 decision, expanded Americans’ constitutionally protected right to publicly carry firearms by striking down a New York law that required those seeking a license to carry a handgun to demonstrate a legitimate reason for doing so.

Associate Justice Clarence Thomas wrote the court’s opinion, which states that “the Second and Fourteenth Amendments protect an individual’s right to carry a handgun for self-defense outside the home.” However, a concurring opinion written by Associate Justice Brett M. Kavanaugh and joined by Chief Justice John G. Roberts Jr. emphasized that the Constitution still allows for a “variety” of gun regulations.