Democratic Sen. Mary Landrieu had pushed the chamber to take its first-ever vote on the pipeline after a half-decade of debate. The result was what Senate-watchers called the biggest nail-biter vote in years.
She fell one vote shy of putting a pipeline bill on the president's desk — which would have forced Obama to deal with the issue sooner than he'd hoped.
Landrieu's party colleagues walked by. The vast majority were lining up to vote against the plan, though one fellow pro-pipeline Democrat hugged her. Landrieu got affectionate greetings from Republicans who'd worked with her on the bill.
"You're a fighter," one Republican told Landrieu on the Senate floor, as he shook her hand.
She fought, and lost. The chamber fell one vote short of the 60 per cent majority needed to override a filibuster. Polls now suggest she'll lose her seat in the pro-oil state of Louisiana in a run-off election next month.
The Keystone XL pipeline, on the other hand, will live to fight another battle.
Republicans vowed to bring the issue back in the new year — under circumstances potentially more favourable to them, to the president, and to the project's proponents.
By early 2015, an ardently pro-oil, Republican-dominated Congress will have been sworn in. A court case over the route should be cleared up in Nebraska. And the State Department should be done with its on-again-off-again regulatory review.
The next leader of the Senate promised to make it a priority.
"The Senate will act again on this important legislation," Republican leader Mitch McConnell said. "I look forward to the new Republican majority taking up and passing the Keystone jobs bill early in the New Year."
By then Obama could, in theory, gain a political concession in return for approving the pipeline. The White House was asked about a report that he'd plan to make a deal with Republicans: They get a pipeline, and he gets a bill he wants — perhaps on infrastructure funding.
An Obama spokesman didn't deny that possibility. When asked whether he was weighing those kinds of next steps, Josh Earnest said: "Yeah, I think that's probably fair to say."
It remains to be seen whether there's a deal to be had.
Obama would have to face the wrath of his base, which vigorously opposes the project. Signs of that opposition were noisily evident in the Senate gallery Tuesday. Even after winning the vote, anti-pipeline protesters erupted in chants, prompting security to whisk them away.
And Republicans would have to give up a favoured cudgel. While they profess frustration over the interminable debate, it's been useful to them as a rod to repeatedly beat up on the president — a favourite item to pull out in any debate over the U.S. economy, as an example of how they'd create more jobs than him.
The president has sought to blunt that weapon lately. When he talks about the pipeline these days, Obama is increasingly dismissive of its significance — and now essentially argues that it will have no effect on the U.S. economy.
He says he'll make his decision on environmental grounds.
The pipeline company appears cognizant of the political sensitivity. TransCanada Corp. issued a statement Tuesday that heaped praise on supporters from both parties.
"Today's vote in the U.S. Senate demonstrates a growing and high level of support for Keystone XL both in the Senate and in the House of Representatives," said a statement from company president Russ Girling.
"Senators Mary Landrieu and (Republican) John Hoeven are to be commended for leading a bipartisan coalition in support of a legislative solution to the protracted regulatory process Keystone XL has languished in for six years."
The Government of Canada was only marginally more aggressive. Natural Resources Minister Greg Rickford issued a statement blaming the delay on "U.S. politics" — without singling out any people or party.
The Democratic leadership in the Senate had stalled any attempt to vote on Keystone before Tuesday. The party is divided over the issue, and had failed to bring numerous House bills to the floor.
A frantic effort from Landrieu had succeeded in convincing her leadership to allow a vote.
In the dying moments of a six-hour debate Tuesday, Landrieu called the project a "no-brainer" — echoing a phrase famously uttered by Prime Minister Stephen Harper.
She said America had always had friends, ever since the French and Dutch had helped it in the Revolutionary War. Now was the time, she said, to build an energy partnership with Canada.
"Who is the best energy partner we could have?" Landrieu asked, referring to the northern neighbour.
"I'm sure they're listening to this debate, feeling very offended."
The debate looked like a battle of duelling charts.
As they delivered speeches, supporters stood next to maps showing all the other pipelines on the continent and flow-charts showing how long the Keystone XL project had been delayed.
An opponent stood next to a poster that said, "Misery Follows Tar Sands." California's Barbara Boxer also showed pictures of oil-linked pollution, and linked the toxins in oil to a litany of ailments ranging from cancer to asthma.
"What does XL stand for?... For me, it's Extra-Lethal," Boxer said, showing pictures of a dark sky over a Texas refinery.
"This is what it looks like in Port Arthur, Tex. And this is what the kids have to put up with. Here is a playground, in a low-income community... We will have to bear the burdens of the refining. The filth in the air. The petcoke in our cities — as we see the products being exported to other countries... This trail of misery should not be put upon the American people."
The debate also featured duelling donors.
The string of speakers who led off the debate happened to be the top recipients of cash from pro- and anti-oil constituencies in U.S. federal politics — where donations from companies and special interests remain legal.
On the pro-pipeline side, Landrieu was the No. 3 recipient in donations from the oil-and-gas sector among all 535 members of the U.S. Congress in the last election cycle, according to the Center for Responsive Politics, a pro-transparency group that tabulates known corporate donations. The man who launched the debate, McConnell, was the No. 4 recipient.
On the opposing side, Boxer was the No. 2 listed recipient of alternative-energy donations in her last Senate election campaign. The only member who received more that year was top Senate Democrat Harry Reid — who until now was responsible for blocking a Keystone vote.
The bill's original sponsor dismissed the president's claim that the pipeline would simply export oil through the U.S. He pointed out that the project would gather crude from his own state.
"It's not just oil from Canada," said Hoeven, a Republican whose bill was co-sponsored by Landrieu. "It's oil from my state of North Dakota. And oil from Montana. Light, sweet crude."
Hoeven's biggest donor, according to the Center for Responsive Politics: the oil and gas sector.