A bill to approve the Keystone XL oil pipeline failed in the Senate on Tuesday by just one vote, in a setback not only for the energy project but the politically imperiled Democratic senator who pushed the legislation.

The bill failed on a 59-41 vote. It needed 60 to pass.

Sen. Mary Landrieu, D-La., had resurrected the legislation ahead of a tough runoff election next month, hoping to show her Washington clout and put Congress on record in support of the pipeline -- even though the White House indicated President Obama would consider vetoing.

With pipeline backers falling short and the project still stuck in a State Department review process, Republicans already vowed to bring up the legislation in the next session when they have complete control of Congress.

"This will be an early item on the agenda in the next Congress," Senate Republican Leader Mitch McConnell said after the vote.

More On This...

Landrieu's intense lobbying effort ultimately wasn't enough to push the legislation through in the lame-duck session. She had been scrambling to corral the needed 60 votes in the final hours of debate, making phone calls and impassioned remarks from the floor.

The senator was trying to win over Democratic converts to push the pipeline forward, and also help her struggling Senate runoff bid. Landrieu was forced earlier this month into a Dec. 6 runoff against GOP Rep. Bill Cassidy. The House passed its own bill last Friday, with help from Cassidy.

But while all 45 Senate Republicans backed the Senate bill, Landrieu wasn't quite able to persuade enough Democratic colleagues.

Landrieu said after the vote that she does not blame anyone in the Senate for the bill's failure, saying it simply proves that "we have to work our muscle a little a more."

"For jobs, for economic opportunity, for independence, for energy independence --- this fight was worth having," she said.

Her possible road to passage narrowed Monday as Sens. Amy Klobuchar, D-Minn., and Carl Levin, D-Mich. -- two potential flips -- reaffirmed they would vote "no." It narrowed even further after Maine independent Sen. Angus King declared Tuesday he would oppose the bill, even though he said he is "frustrated" that Obama has not made a decision.

Several liberal Democrats actively lobbied against Landrieu on the vote -- Sen. Brian Schatz of Hawaii, for example, blasted an email to supporters on Monday asking them to sign a petition against Keystone.

Sen. Barbara Boxer, D-Calif., argued on the Senate floor Tuesday that the project could lead to China-style pollution and other hazards.

But Landrieu argued that the natural resources are going to be extracted regardless.

"It's a high-tech, state-of-the-art pipeline that's going to put thousands of people to work," Landrieu said. "This has absolutely nothing to do with climate change."

The vote nevertheless offers a preview of what is ahead for Obama on energy and environmental issues when the Republicans take control of both houses of Congress next year.

For six years, the fate of the Keystone XL oil pipeline has languished amid debates over global warming and the country's energy security. The latest delay came after a lawsuit was filed in Nebraska over its route.

The proposed crude-oil pipeline, which would run 1,179 miles from the Canadian tar sands to Gulf coast refineries, has been the subject of a fierce struggle between environmentalists and energy advocates ever since Calgary-based TransCanada proposed it in 2008.

Fox News' Kara Rowland and The Associated Press contributed to this report.