“They blocked common-sense gun reforms even while these families looked on from the Senate gallery,” Obama said, standing with parents of some of the 20 children killed in the Sandy Hook Elementary School rampage by a young man with a semiautomatic rifle.

In an emotional Rose Garden statement after the vote, Obama accused gun-rights groups of distorting the debate to help block the most significant gun legislation that stood a chance of passage.

WASHINGTON — Compromise legislation to expand mandatory background checks for gun sales failed Wednesday in the Senate, killing the best hope for proponents seeking action following the Newtown, Conn., elementary school massacre and prompting President Obama to label it “a pretty shameful day for Washington.”


Proponents needed 60 votes to prevent a filibuster on the background-check amendment, and they fell short, 54 to 46. New Hampshire Republican Kelly Ayotte was the only New England senator to vote no, among the 41 Republicans and five Democrats who were opposed.

“Shame on you!” a spectator in the gallery yelled out in the chamber, prompting Vice President Joe Biden, who was presiding over the chamber in a symbol of the legislation’s importance to the administration, to gavel for order.

Many Republicans who opposed the legislation, which would have expanded background checks to gun shows and online sales, called it a slippery slope that would compromise the Second Amendment and would not ward off all future violence.

“Restricting the rights of law-abiding gun owners will not prevent a deranged individual or criminal from obtaining and misusing firearms to commit violence,” Ayotte said in a written statement. The legislation, she said, “would place unnecessary burdens on law-abiding gun owners and allow for potential overreach by the federal government into private gun sales.”

Chris Cox, chief lobbyist for the National Rifle Association, thanked the senators who blocked the amendment. “Expanding background checks, at gun shows or elsewhere, will not reduce violent crime or keep our kids safe in their schools,” he said in a statement.


The Senate also defeated an amendment to ban sales of assault weapons, 40 to 60. Ayotte, Maine Republican Susan Collins, and Maine independent Angus King were the only New England senators to vote no. Proponents and opponents alike had predicted that provision would fail, in the face of opposition from Democrats from rural states.

The votes were a rebuke for a president who made gun control an emotional centerpiece of his State of the Union speech in January. Along with immigration reform and fiscal issues, guns have been a top item on his second-term agenda.

Without the compromise amendment on background checks, the overall gun bill, which contained some less controversial parts such as prohibiting “straw buyers’’ from purchasing guns for felons, will not win support. Senate majority leader Harry Reid is expected to pull the bill from consideration, leaving the possibility of future measures uncertain.

Polls show that nearly 90 percent of Americans support a strong system of background checks for gun purchases. But the failure of the amendment illustrates how vocal minorities were able to strongly influence the debate by targeting individual senators with outside pressure, channeled through Internet organizing.

Groups beyond the National Rifle Association, the traditional representative of the gun lobby, played a major role. The National Association for Gun Rights used e-mail alerts, online videos, and a Facebook page to convey mocking imagery that targeted individual senators. “NO DEALS, NO GUN CONTROL,” the group blasted on its website.


In a series of Facebook posts, the group showed Obama as a puppeteer, controlling the strings of Pennsylvania Republican Pat Toomey, who forged the compromise amendment on background checks with a Democrat, West Virginia’s Joe Manchin. Stamped in red ink on the image: “Toomey Sold Out Your Gun Rights.”

On Monday, the group posted a doctored photo of Collins — one of 16 Republicans who voted last week to prevent an initial GOP filibuster on gun laws — with her eyes bulging as if she were a zombie. Within an hour, 5,413 people liked it on Facebook.

Collins was bombarded by a host of groups in recent days. Organizing for Action, an offshoot of President Obama’s campaign network, ran an ad Friday on the Bangor Daily News website with this message: “Tell Senator Collins: It’s time to close background check loopholes.” That ad came a day after a full-page ad from the National Rifle Association that asked, “Will Obama’s gun control proposals actually work? His own experts say, ‘No.’ ”

Senator John McCain of Arizona praised Manchin and Toomey for their efforts during the debate preceding the series of votes. “You did the right thing,” said McCain, who was one of four Republican senators to vote for the measure. “What they have tried to do today I think is an act that should be appreciated by those of us who many times avoid taking the tough decisions.”


Senator Christopher Murphy, a Connecticut Democrat in favor of gun control, spoke on the Senate floor against the outsized influence of the gun lobby and his colleagues’ complacency. “The longer that I’ve spent in this place, the more I’m convinced that there are people who actually do believe that we should just go back to the days of the wild, wild west,” he said.

In an interview after the vote, Murphy said, “I think there’s going to be outrage in this country tomorrow. There is a big political price to pay for senators who went against the will of 90 percent of their constituents.”

Democratic Senator Elizabeth Warren of Massachusetts denounced both gun lobbyists and the senators they support. “A minority of senators does the bidding of special interest groups that are more interested in profits than lives,’’ she said in a statement.

Democrats from Alaska, Arkansas, and North Dakota voted against the background checks amendment, along with Montana Democrat Max Baucus, a key member of the Senate leadership as chairman of the Senate Finance Committee. Reid, a supporter of the plan, switched his vote to the prevailing ‘‘no’’ side to permit him to call for a revote in the future.

The emotional loss for proponents was evident in Obama’s Rose Garden appearance, where he was flanked by former Arizona representative Gabrielle Giffords, who was shot in the head during a town hall meeting in Tucson in 2011. Biden stood grimly nearby, his arms crossed.


Mark Barden, whose 7-year-old son Daniel was killed at Sandy Hook, took to the podium, his voice quavering, and vowed to continue lobbying for change in Washington.

“In any instant, any dad in America could be in my shoes. No one should feel the pain,” Barden said. “We’ll return home now, disappointed but not defeated. We will always be here because we have no other choice. We are not going away.”

Obama said the pro-gun lobbyists distorted the intent of the background checks in a bid to rile up gun owners and intimidate senators.

“It came down to politics — the worry that the vocal minority of gun owners would come after them in future elections,” Obama said. “They caved to the pressure, and they started looking for an excuse — any excuse — to vote no.”

Obama also took the unusual step of singling out a remark of an individual senator for rebuke, making a veiled swipe at Kentucky Republican Rand Paul for comments Paul made Wednesday. Paul criticized the president for using the Sandy Hook families “as props.”

Obama addressed the comment and similar remarks, without mentioning Paul by name.

“ ‘A prop,’ somebody called them,’’ he said. “Are they serious? Do we really think that thousands of families whose lives have been shattered by gun violence don’t have a right to weigh in on this issue? Do we think their emotions, their loss is not relevant to this debate?”

Globe correspondent Julia Edwards contributed to this report. Matt Viser can be reached at maviser@globe.com. Tracy Jan can be reached at tjan@globe.com.