Congress is on the verge of approving a 13-billion-dollar (£10.59 billion) bipartisan gun violence bill that seemed unimaginable a month ago.

House approval is expected on Friday on legislation that would be US politicians’ most sweeping answer in decades to brutal mass shootings.

The vote comes exactly one month after a gunman massacred 19 students and two teachers at an elementary school in Uvalde, Texas. Just days before that, a white man motivated by racism allegedly killed 10 Black grocery shoppers in Buffalo, New York.

Senator Chris Murphy who led the Democrats in bipartisan Senate talks to rein in gun violence, pauses for questions from reporters, at the Capitol in Washington, Wednesday, June 22, 2022
The Senate easily approved a bipartisan gun violence bill that seemed unthinkable just a month ago, clearing the way for final congressional approval (J Scott Applewhite/AP)

The two slaughters — days apart and victimising helpless people for whom the public felt immediate empathy — prompted both the Democrat and Republican parties to conclude that Congress had to act, especially in an election year.

After weeks of closed-door talks, Senate bargainers from both parties produced a compromise taking mild but impactful steps toward making such mayhem less likely.

“Families in Uvalde and Buffalo, and too many tragic shootings before, have demanded action. And tonight, we acted,” President Joe Biden said after passage. He said the House should send it to him quickly, adding: “Kids in schools and communities will be safer because of it.”

The legislation would toughen background checks for the youngest gun buyers, keep firearms from more domestic violence offenders and help states put in place red flag laws that make it easier for authorities to take weapons from people adjudged dangerous. It would also fund local programmes for school safety, mental health and violence prevention.

Gun control advocates protest in Christopher Columbus Park, on Saturday, June 11, 2022, in Boston
President Joe Biden said ‘kids in schools and communities will be safer’ because of the bill (Michael Dwyer/AP)

The Senate approved the measure on Thursday by 65-33. Fifteen Republicans — a remarkably high number for a party that has derailed gun curbs for years — joined all 50 Democrats, including their two independent allies, in approving the bill.

Still, that meant that fewer than one-third of GOP senators backed the measure. And with Republicans in the House expected to solidly oppose it, the fate of future congressional action on guns seems dubious, even as the GOP is expected to win House and possibly Senate control in the November elections.

Top House Republicans urged a “no” vote in an email from the No 2 GOP leader, Steve Scalise of Louisiana. He called the bill “an effort to slowly chip away at law-abiding citizens’ 2nd Amendment rights”.

A teacher holds a sign during a gun control rally outside City Hall in Los Angeles on Saturday, June 11, 2022
Senate majority leader Chuck Schumer called it ‘a long overdue step in the right direction’ (Keith Birmingham/The Orange County Register/AP)

While the bill was noteworthy for its contrast with years of stalemate in Washington, it falls far short of more robust gun restrictions Democrats have sought and Republicans have thwarted for years. Those included bans on the assault-type weapons and high-capacity ammunition magazines used in the slayings in Buffalo and Uvalde.

Yet the accord let both parties’ Senate leaders declare victory and demonstrate to voters that they know how to compromise and make government work, while also leaving room for each side to appeal to its core supporters.

“This is not a cure-all for the all the ways gun violence affects our nation,” said senate majority leader Chuck Schumer, whose party has made gun restrictions a goal for decades. “But it is a long overdue step in the right direction.”

Senate minority leader Mitch McConnell, in a nod to the Second Amendment right to bear arms that drives many conservative voters, said: “The American people want their constitutional rights protected and their kids to be safe in school”.