The Senate on Wednesday voted down a bipartisan compromise measure that would have expanded the use of background checks for gun buyers, all but dooming the chances of comprehensive gun control that President Obama sought in the aftermath of a mass shooting at a Connecticut elementary school.

A woman in the Senate gallery shouted, "Shame on you," after the Senate voted 54-46 against a compromise worked out by Sens. Joe Manchin, D-W.Va., and Pat Toomey, R-Pa., that would have required background checks for all guns purchased from commercial outlets. The measure needed 60 votes to pass.

President Obama, appearing in the White House Rose Garden shortly after the vote, blasted Republicans and the National Rifle Association for defeating a measure that has overwhelming public support, saying, "This is a pretty shameful day for Washington."

"They blocked common-sense gun reforms, even while these families looked on from the Senate gallery," Obama said, with Newtown, Conn., family members, Vice President Joe Biden and former U.S. Rep. Gabby Giffords of Arizona at his side. "It came down to politics ... They caved to the pressure."

Manchin and Toomey, moved by lobbying relatives of Sandy Hook Elementary School victims to work on a compromise, had hoped their provision would attract wavering Democrats and enough Republicans to clear the 60-vote threshold.

The compromise, if it passed, was expected to improve the chances of a broader gun control bill passing. The overall bill would increase funding for school safety initiatives and impose tougher penalties for gun trafficking.

Without the provision, the bill is unlikely to pass the Democratic Senate, let alone the Republican House.

The Toomey-Manchin amendment would have expanded background checks to include Internet sales and gun shows but would have excluded private transactions between family members, neighbors and acquaintances who share guns or give them as gifts.

But support for the Toomey-Manchin deal collapsed in recent days, with lawmakers saying the provision would infringe on Second Amendment rights while doing little or nothing to curb gun violence.

As the gun lobby ratcheted up opposition to the measure, once-wavering Republicans lost enthusiasm for the compromise, as did a handful of Democratic senators from pro-gun states who are up for re-election in 2014.

Toomey and just three other Republican senators -- John McCain of Arizona, Susan Collins of Maine and Mark Kirk of Illinois -- voted for the compromise.

Republican opponents of the compromise pointed to the lack of enforcement of existing background-check violations. Justice Department data show only a few dozen gun buyers who lied on background checks were prosecuted even though there have been thousands of such violations.

"I believe the most appropriate response to the mass shootings is to make sure our current laws are enforced more aggressively and more efficiently," Sen. John Cornyn, R-Texas, said. "We should not be making it harder for law-abiding citizens to exercise their constitutional rights."

The GOP also warned that background checks would lead to a national gun registry, which might be used some day by the government to round up lawfully owned weapons.

"Background checks today, gun registries tomorrow, who knows what might follow after this," Sen. Richard Shelby, R-Ala., said before the vote.

Earlier in the day, Senate Majority Leader Harry Reid, D-Nev., a gun owner from a decidedly pro-gun state, took a jab at those who not only opposed background checks but stricter measures that would have banned assault-style weapons and limited the size of ammunition magazines.

"I'll vote for the ban because maintaining the law and order is more important than satisfying conspiracy theories about black helicopters and false flags," Reid said.