Passage provides the new Congress with a legislative victory after a series of stumbles in the early weeks of Republican control. The House voted 270-152, as Democrats joined most Republicans to approve the bill, following similar bipartisan passage by the Senate.
Republican leaders from both chambers celebrated the hard-fought achievement in a ceremonial room in the Capitol on Wednesday, and dared Obama to defy environmental advocates pushing him to kill the project.
"Instead of listening to the people, the president's standing with a bunch of left fringe extremists and anarchists," House Speaker John A. Boehner (R-Ohio) said before Wednesday's vote. "The president needs to listen to the American people and say, 'Yes, let's build the Keystone pipeline.'"
Obama has already vowed to veto the bill. The measure would effectively allow Congress to bypass his authority to approve or reject the project. The administration prefers to allow the ongoing State Department review to be completed before Obama makes a final decision.
Congress does not appear to have the votes to override a presidential veto, even though 29 Democrats in the House and nine in the Senate joined most Republicans in supporting passage.
The $8-billion pipeline would haul oil from the tar sands of Alberta, Canada, through the American heartland to Nebraska, for eventual delivery to the Gulf Coast.
Supporters call it a jobs bill that will unleash new energy resources and 42,000 construction and related jobs.
But a State Department review showed the number of permanent jobs would drop to just 35 once the line is operating.
"There is no reason to continue to stall this project," said Rep. Jeff Denham (R-Turlock), who called it the "safest pipeline ever."
Opponents worry the new infrastructure will only increase global oil dependence, worsen climate change and pose environmental risks.
As oil prices have plummeted, some analysts have questioned whether the project pencils out.
But Congress has pressed forward, and the legislation became a crucial early test for the new Republican majority, which made passage of the Keystone legislation a top priority.
After initial approval in the House in January, the pipeline bill got bogged down in the Senate after Majority Leader Mitch McConnell promised a free-wheeling debate as part of his commitment to running an open Senate.
Three weeks and nearly 50 amendment votes later, the Senate approved the measure -- but only after Democrats succeeded in tacking on a couple of changes that sent the bill back to the House.
One amendment put Congress on record agreeing that “climate change is real and not a hoax” -- a provision designed to embarrass some Republicans who have questioned the causes of global warming. The House had to accept the change.
"That is tremendous progress for the Republican side," said Rep. Pete DeFazio (D-Ore.) during the House debate Wednesday, even as he said he would oppose the Keystone bill.
The Senate rejected, however, a similar amendment that would have declared a link between human activity and climate change.
The bill is not expected to land on the president's desk any time soon.
Congress is expected to mark the bill's passage with a ceremony later this week, and send it to the White House at the end of the month, after lawmakers return from their weeklong break.
For the latest from Congress follow @LisaMascaro