After almost a week of political jockeying, the Senate today rejected legislation that would repeal tax breaks for the biggest five oil companies and would extend 19 renewable energy tax subsidies that expired at the end of 2011 or are near expiring.

The Senate voted 51-47, failing to reach the 60 votes needed to cut off debate.

The 47 votes against the bill included Democratic Sens. Mark Begich (Alaska), Mary Landrieu (La.), Ben Nelson (Neb.) and Jim Webb (Va.), who voted with Republicans against cutting off debate on the bill.

Republican Sens. Susan Collins (Maine) and Olympia Snowe (Maine) joined with most other Democrats in supporting the measure.

Minutes before the Senate vote, President Barack Obama exhorted the chamber to finally eliminate oil company subsidies after a century.

“American oil is booming,” he said. “The oil industry is doing fine. With record profits and rising production, I’m not worried about the big oil companies. With high oil prices around the world, they’ve got more than enough incentive to produce even more oil.”

Obama also poured cold water on the argument that increased production would lower prices.

“The fact that we’re doing more here in the United States doesn’t necessarily help us, because even U.S. oil companies, they’re selling that oil on a worldwide market. They’re not keeping it just for us,” he said.

Senate Majority Leader Harry Reid (D-Nev.) had set up the vote earlier this week on the measure, sponsored by Sens. Bob Menendez (D-N.J.) and Debbie Stabenow (D-Mich.). The Senate had initially been expected to debate a postal reform measure this week, but turned to the Menendez-Stabenow bill after Republicans decided to take Democrats up on the offer to debate energy policy.

Republicans agreed to bring the measure up because they believed they could capitalize politically with gas prices edging upward.

Democrats also saw an opportunity to hit home their message that the tax code is skewed toward the wealthy, something they say was exacerbated by Congressional Republicans and the administration of President George W. Bush.

“Over the past decade, the five major oil companies have made more than a trillion dollars. That’s not billions, that’s a ‘t,’ trillions,” Reid said before the vote.

“Even oil executives admit an industry making hundreds of billions of dollars in profit every year doesn’t need a hand out from the American taxpayer,” Reid continued. “We agree.” And “so do almost 80 percent of the American people.”

Republicans argued that the bill would result in higher gas prices as a result of oil companies passing on their higher tax bill to consumers.

Senate Minority Leader Mitch McConnell (R-Ky.) also said the bill shows that Democrats are out of touch on the issue.

“Is this the best we have to offer folks who are staring at $4-a-gallon gasoline?” McConnell asked before the vote. “A bill that even Democrats admit won’t do anything to lower the price of gas? And a process that blocks any other idea from even coming to the floor for a vote?

“Well, if you don’t — if you think we think we should do more for the American people at a time when they’re paying $4-a-gallon for gasoline than raise taxes on energy manufacturers and block a pipeline from Canada, then you should vote against cloture,” McConnell continued.

Republicans argue that Democratic leaders and the White House should support the Keystone XL pipeline, a 1,700-mile oil project from Canada to the Gulf Coast. Democrats argue it’s a matter of safety. Last week Obama, looking to blunt GOP criticism, went to Cushing, Okla., to support the southern half of the Keystone project, which would run from Cushing to the Gulf Coast. The northern portion still needs federal approval, but only after a proper review to ensure its safety, he said. A route has not yet been chosen through Nebraska after the initial path faced opposition in that state over concerns a spill would affect underground water supplies and the environment.

Congress passed a measure in December forcing the White House to make a decision on TransCanada’s permit request for the cross-border pipeline, and Obama rejected it in January on the grounds that his administration did not have enough time to review the effects.

Speaker John Boehner (R-Ohio) also weighed in.

Pointing to rising gas prices, Boehner expressed disappointment that Obama hadn’t followed up on a conversation the two had about energy proposals.

“One month ago today, during a conversation at the White House, I was encouraged by the president’s willingness to discuss the possibility of working together on some of the bipartisan House-passed energy bills,” Boehner said at a press conference. “Many of these bipartisan proposals have received support from the president’s own job council. But gas prices have gotten worse and the administration has taken absolutely no action.”

Boehner also spoke about an investigation by Energy and Commerce Chairman Fred Upton (R-Mich.) into a Department of Energy loan program for renewable energy companies, calling the program “Solyndra-style stimulus” and hitting the Obama administration for not releasing internal documents.

“More than $10 billion — with a ‘b’ — has been spent on this,” Boehner said.

“Department of Energy Secretary [Stephen] Chu said it created tens of thousands of jobs, except there’s no evidence to support that. The Energy and Commerce Committee set a deadline for today for the Energy Department and the Treasury Department to produce documents or information about what taxpayers got for their $10 billion. The administration thus far has failed to provide the committee with any information to justify this claim.”

Steven T. Dennis and Jonathan Strong contributed to this report.

Correction: March 29, 3 p.m.

An earlier version of this article incorrectly stated that Sen. Mark Warner (Va.) voted with Republicans against cutting off debate on the bill. The Virginia Democrat who voted with Republicans was Sen. Jim Webb.