After every attempt to restrict gun ownership failed Wednesday night, President Obama called it “a pretty shameful day for Washington."

While Obama targeted Republicans in his remarks, his own party helped bring down the legislation.

Only two amendments passed -- one that deals with mental health, not guns, and another that would protect gun owners from having their names released by state governments.

Who were the Democrats who sided most often with Republicans on Wednesday? Sens. Max Baucus (Mont.), Mark Begich (Alaska), Heidi Heitkamp (N.D.) and Mark Pryor (Ark.), all of whom voted against every Democratic piece of gun legislation save for a crackdown on trafficking, and for every piece of Republican gun legislation.

Sen. Max Baucus (D-Mont). (Photo by Astrid Riecken For The Washington Post)

That's no surprise -- three of the four are up for reelection next year in states that went heavily for Mitt Romney last fall. Heitkamp won't face voters until 2018, but she's in a very red state and was elected by only a narrow margin in 2012. All but Pryor get high marks from the National Rifle Association; he gets a middling C-. Baucus' Montana has more gun businesses than any state in the country; Alaska is not far behind.

Sen. Kay Hagan (N.C.), another vulnerable Democrat up in 2014, voted for background checks, but with Republicans on everything else save gun trafficking. Sen. Mary Landrieu (La.) is in the same boat and voted the same way. So did Sen. Joe Donnelly (Ind.) and Joe Tester (Mont.) who like Heitkamp were elected (or in Tester's case reelected) in conservative states. Sen. Martin Heinrich (N.M.), elected last year to a blue-leaning state, broke with Democrats on the assault weapons ban, concealed-carry and privacy.

Sen. Mark Udall (D-Colo.), up next year in a swing state, voted for expanding concealed-carry, against the assault weapons ban and for gun owners' privacy but with Democrats on everything else. Sen. Jeanne Shaheen (D-N.H.), another swing-state senator up in 2014, only broke with her party on the privacy amendment. Polls suggest Sen. Jeff Merkley could be vulnerable in Oregon; he broke with his party only on gun owners' privacy. On the flip side polls make it hard to believe Sen. Mark Warner will lose in Virginia; he broke with Democrats on concealed-carry, assault weapons, high-capacity magazines and privacy.

The privacy amendment got 22 Democratic votes; basically anyone in even a somewhat swing state voted for it. There could be a race for Sen. Al Franken's (D-Minn.) seat, but he voted with Democrats on everything.

While Sen. Joe Manchin (D-W.V.) was behind the push for expanded background checks, he voted against the assault weapons ban and the high-capacity magazines ban and for expanded conceal-carry.

The most anti-gun Republican was Mark Kirk of Illinois, the only member of the GOP to vote for  the assault weapons ban and for the ban on high-capacity clips. He was the only Republican to vote against an expansion of concealed-carry rights. The only GOP legislation he supported was Wyoming Sen. John Barrasso's successful amendment restricting states' ability to release gun owners' names and North Carolina Sen. Richard Burr's failed effort to let veterans deemed incapable of handling their financial affairs keep their gun rights.

Kirk also voted for a crackdown on gun trafficking and against Republican alternative gun legislation, which made it easier to carry a gun across state lines. Sen. Lisa Murkowski (R-Alaska) voted for the anti-trafficking legislation but with her party on everything else.

Sen. Mike Lee (R-Utah) voted against the Republican alternative amendment but for everything else. He thought that legislation intruded on law enforcement and education functions best left to states. Republicans Susan Collins (Maine), John McCain (Ariz.) and Pat Toomey (Pa.) broke ranks on background checks but nothing else.

Again, Kirk's position is not surprising; he represents a state that supported Obama last year by 16 points and where the role of guns in gang violence is an issue. Leahy and Collins' trafficking amendment was named in part for Hadiya Pendleton, a teenager who was shot and killed in Chicago.