WASHINGTON — The Senate on Wednesday failed to override President Barack Obama’s veto of a bill to construct the Keystone XL pipeline, the first of many confrontations between the Republican-controlled Congress and the White House this year over energy policy.

The 62-37 vote is expected to be one of many veto showdowns between Republicans and Obama in his final term. Already, the White House has issued more than a dozen veto threats on legislation.

Proponents of the Keystone bill have said since its introduction that they didn’t have the two-thirds of the Senate vote needed to override Obama’s veto. They fell four votes short. But they’ve already been discussing other ways to force the pipeline’s approval, either by attaching it to must-pass spending bills or other, broader, energy legislation.

“If we don’t win the battle today, we will win the war because we will find another bill to attach this pipeline to,” said Sen. John Hoeven, R-N.D., the chief sponsor of the bill, before the vote.

Majority Leader Mitch McConnell pleaded with Democrats for more support of a bill that he said advanced the president’s own priorities.

“If you’re interested in jobs and infrastructure and saving your party from an extreme mistake, then join us,” he said. “Vote with us to override a partisan veto and help the president pursue priorities he’s advocated in the past.”

But two Democrats, Sen. Sheldon Whitehouse of Rhode Island and Sen. Edward Markey of Massachusetts, said at a news conference after the vote that further attempts to pass the project would be futile, especially given the failed attempt to overturn Obama’s immigration policies using a bill to fund the Department of Homeland Security.

The senators called the push on Keystone “politically delusional” and a “waste of time.”

“The Republican pipe dream to pass this pipeline through Congress is over,” Markey said. “The Senate today said the president should get to keep his prerogative.”

Obama has repeatedly resisted Congress’ attempts to force his hand. His veto of the bill, the third of his presidency, said that the bill circumvented longstanding and proven processes for determining whether cross-border pipelines serve the national interest and cuts short consideration of its effects.

The $8 billion project would transport oil extracted from Canada’s tar sands to pipelines linked to Gulf Coast refineries.

Environmentalists have framed the pipeline as a test of Obama’s commitment to address climate change, arguing that it would open up a path for tar sands oil to get to market. Republicans have pushed the pipeline as a job-creating infrastructure project that will supply the U.S. with oil from a friendly neighbor, rather than unstable regimes.

The State Department’s analysis found that the oil would be harvested regardless of whether the pipeline is built, a conclusion that the EPA said needed to be re-examined given low oil prices. The same review said the pipeline would create thousands of jobs during construction, but ultimately it would require 35 permanent employees.

DINA CAPPIELLO, Associated Press