WASHINGTON -- The House sent President Joe Biden the widest ranging gun violence bill Congress has passed in decades Friday, a measured compromise that at once illustrates progress on the long-intractable issue and the deep-seated partisan divide that persists.

The Democratic-led chamber approved the election-year legislation on a mostly party-line 234-193 vote, capping a spurt of action prompted by voters' revulsion over last month's mass shootings in New York and Texas. The Senate approved the measure late Thursday by a bipartisan 65-33 margin.

Every House Democrat and 14 Republicans – six of whom won't be in Congress next year – voted for the measure. House Speaker Nancy Pelosi, D-Calif., underscored its significance to her party by taking the unusual step of presiding over the vote and announcing the result from the podium, to huzzahs from rank-and-file Democrats on the chamber's floor.

Among Republicans backing the legislation was Rep. Liz Cheney of gun-friendly Wyoming, who has broken sharply with her party's leaders and is helping lead the House investigation into last year's Capitol insurrection by supporters of then-President Donald Trump. In a statement, she said that "as a mother and a constitutional Conservative," she believed the bill would curb violence and enhance safety, adding: "Nothing in the bill restricts the rights of responsible gun owners. Period."

Impossible to ignore was the juxtaposition of the week's gun votes with a pair of jarring Supreme Court decisions on two of the nation's most incendiary culture war issues. The justices on Thursday struck down a New York law that has restricted peoples' ability to carry concealed weapons, and Friday it overturned Roe v. Wade, eliminating the protection for abortion that case had ensured for a half-century.

The bill, crafted by senators from both parties, would incrementally toughen requirements for young people to buy guns, deny firearms from more domestic abusers and help local authorities temporarily take weapons from people judged to be dangerous. Most of its $13 billion cost would go to bolster mental health programs and for schools, which have been targeted in Newtown, Connecticut, Parkland, Florida and many other infamous massacres.

It omits far tougher restrictions Democrats have long championed like a ban on assault-type weapons and background checks for all gun transactions, but is the most impactful firearms violence measure Congress has approved since enacting a now-expired assault weapons ban in 1993.

The legislation was a direct result of the slaying of 19 children and two teachers at an elementary school in Uvalde, Texas, exactly one month ago, and the killing of 10 Black shoppers days earlier in Buffalo, New York. Lawmakers returned from their districts after those shootings saying constituents were demanding congressional action, a vehemence many felt could not be ignored.

"This gives our community the sorely needed hope that we have been crying out for, for years and years and years," Rep. Lucy McBath, D-Ga., whose 17-year-old son was shot dead in 2012 by a man complaining his music was too loud, told supporters outside the Capitol. "Understand and know that this bill does not answer all of our prayers, but this is hope."

Speaking haltingly, Rep. Steven Horsford, D-Nev., said he was backing the bill for his father, shot to death 30 years ago to the day, the 58 people killed in a 2017 mass shooting in Las Vegas "and so many other Americans who are victims and survivors of gun violence."

For conservatives who dominate the House GOP, it came down to the Constitution's Second Amendment right for people to have firearms, a protection key for many voters who own guns. "Today they're coming after our Second Amendment liberties, and who knows what it will be tomorrow," Rep. Jim Jordan of Ohio, the House Judiciary Committee's top Republican, said of Democrats.

Pelosi said with Thursday's gun ruling by the justices, "the Trump-McConnell court is implicitly endorsing the tragedy of mass shootings and daily gun deaths plaguing our nation." That was a reference to the balance-tipping three Conservative justices appointed by Trump and confirmed by a Senate that was run by Majority Leader Mitch McConnell, R-Ky.

But House Republicans used the gun debate to praise both court decisions. "What a great day for the babies, and as the speaker described it, the Trump-McConnell Supreme Court," said Rep. Scott Fitzgerald, R-Wis.

Rep. Dan Bishop, R-N. C., said the firearms decision has "electrified the country and left radicals seething – the Constitution means what it says."

In the Senate, every Democrat and 15 Republicans backed the compromise. Just two of those GOP senators face reelection next year.

But overall, fewer than one-third of GOP senators and just 1-in-15 House Republicans supported the measure. That means 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.

McConnell kept careful tabs on the negotiations that produced the bill and voted for it, partly in hopes it would attract moderate suburban voters whose support the GOP will need in its November bid for Senate control. In contrast, Minority Leader Kevin McCarthy, R-Calif., and other GOP leaders of the more Conservative House opposed it.

The legislation was opposed by firearms groups like the National Rifle Association. But groups backing gun curbs like Brady and Everytown for Gun Safety weren't the only ones backing it. Support also came from the Fraternal Order of Police and the International Association of Chiefs of Police.

The talks that produced the bill were led by Sens. Chris Murphy, D-Conn., Kyrsten Sinema, D-Ariz., John Cornyn, R-Texas, and Thom Tillis, R-N. C.

Under the compromise, background checks for gun buyers age 18 to 20 will now include an examination of their local juvenile records. The accused shooters in Uvalde and Buffalo were both 18.

People convicted of domestic abuse who are current or former romantic partners of the victim – not simply spouses or people who lived or had children with the person they abused – will be prohibited from acquiring firearms. That closes the so-called "boyfriend loophole."

There will be money to help states enforce "red flag" laws that help authorities temporarily take guns from people considered threatening and for other states' violence prevention programs. More people who sell weapons would have to become federally licensed gun dealers and need to conduct background checks.

Penalties for gun trafficking are strengthened, billions of dollars are provided for behavioural health clinics and school mental health programs and there's money for school safety initiatives, though not for personnel to use a "dangerous weapon."

------

AP reporter Kevin Freking contributed to this report.