“I think the whole country yearned for something real to happen after the terrible tragedies,” Sen. Chuck Schumer of New York, the majority leader, said in an interview last week. Prior to the Texas shooting, he had spent time in Buffalo counseling grieving families after a racist supermarket attack left 10 people dead.

Biden said he would welcome both families affected by gun violence and the lawmakers who helped shape the measure at a White House event in July after a July 4 recess, and said suggested that the compromise was a sign that more bipartisan efforts were possible.

“Their message for us was to do something about it,” Biden said of families and survivors of gun violence. “How many times have you heard that? Just do something. For God’s sake, do something.

“Well, today we did it,” the president added.

For Mr. Biden and others, the compromise reflected decades of work on gun safety legislation. After 20 children were shot and killed in Newtown, Connecticut in 2012, then-Vice President Biden was tasked by President Barack Obama with drafting an executive action list on the fire arms. Mr Biden also called on lawmakers to pass universal background checks, but an effort to pass gun control legislation failed in the Senate.

After the shootings in Buffalo and Uvalde, Mr Biden called for the reinstatement of an assault weapons ban – a restriction he helped pass as a senator that had been in effect for a decade before it expired in 2004.

Most congressional efforts on guns have been thwarted in recent years by the Republican opposition, as the party has largely united to block new gun control measures and prevent this legislation from reaching the 60-vote threshold needed for most bills to advance in the Senate. As lawmakers reeled from the footage from the Texas shooting, party leaders offered their tacit blessing to a small coalition of senators eager to find a compromise.