WASHINGTON — The House on Wednesday passed a bill approving construction of the Keystone XL oil pipeline, setting up a confrontation with President Obama, who has vowed to veto the measure.

The bill, which passed the Senate last month, headed to Mr. Obama’s desk Wednesday night.

Mr. Obama’s expected veto of the bill will not represent a rejection of the pipeline itself. Because the pipeline crosses an international border — with Canada — the president retains the authority to make the final decision on whether to build it.

Congressional Republicans chose the Keystone bill as the first measure to send to Mr. Obama this year in order to use his expected rejection of it as a political weapon against Democrats.

“Instead of listening to the people, the president is standing with a bunch of left-fringe extremists and anarchists,” Speaker John A. Boehner said. “The president needs to listen to the American people and say ‘yes, let’s build the Keystone pipeline.’ ”