The Keystone XL pipeline has become a perfect symbol of Washington’s dysfunction. Democrats exaggerate its environmental impact while Republicans exaggerate its economic benefits. In the debate, each side talks past the other, because each cares more about gaining a political advantage than a policy achievement. Yet a path exists for President Barack Obama to transcend these differences and allow both sides to declare victory.

I’m a strong believer in the need to take bold action on climate change, and I’ve devoted a great deal of time and energy to this work, in the public, private and philanthropic sectors. Ignoring carbon pollution is disastrous for public health, and ignoring the risks associated with climate change is environmentally and economically foolish. But contrary to conventional wisdom, the Keystone pipeline could open up a rare opportunity to achieve progress on climate change.

President Obama vetoed a bill Tuesday that would preempt his review of the pipeline, but he has not indicated whether he will ultimately approve Keystone. Therein lies the opportunity to negotiate a path forward — not with Republicans or Democrats, but with Canadians.

The Canadian government has been pressing the White House to approve the pipeline, which would bring many more economic benefits to Canada than it would to the United States. That gives the White House enormous leverage, which it should use to negotiate a broader, climate-friendly deal that far more than offsets the potential impact of the pipeline.

The timing is right for talks. The Canadian government will face increasing pressure to take a more aggressive approach to climate change in the run-up to the United Nations conference in Paris this December. Prime Minister Stephen Harper has committed $300 million to help developing countries tackle climate change, which is commendable. But there is much more that Canada can be doing at home. According to a recent report on the progress that industrialized countries are making on climate change, Canada ranks near the bottom. The U.S. doesn’t fare much better.

A U.S.-Canada agreement would position Canada as a leader on climate change, while also delivering a big economic boost to its economy. Here in the U.S., Republicans in Congress could declare economic victory, while Democrats could declare environmental victory. The president could declare both, while also burnishing his foreign policy legacy and building momentum for the conference in Paris.

Last year, President Obama reached a breakthrough climate change agreement with China, after traveling to Beijing to meet with President Xi Jinping. Canada and China are the U.S.’s two largest trading partners. Reaching climate agreements with both would be no small feather in his cap. And the flight to Ottawa is a lot shorter.

Canada and the U.S. have always worked together closely on climate-related matters. Canada is our largest supplier of oil, and one of our closest allies. Keystone is a diplomatic issue, and the White House should begin treating it that way. Republicans in Congress who have criticized the president for not being a sufficiently tough international negotiator should insist on nothing less.

As the U.N. secretary-general’s special envoy for cities and climate change, I encourage President Obama and Prime Minister Harper to engage in talks that can lead to an agreement that will benefit both our nations’ economies and environments.

The endless partisan debate over the Keystone XL pipeline has gotten us nowhere. Instead of continuing to argue among ourselves, it would be far more productive to engage our friends north of the border. The gridlock that defines Washington need not curtail diplomacy — nor stand in the way of progress on climate change.

Michael R. Bloomberg, the former mayor of New York City, is the founder and majority owner of Bloomberg LP, the parent company of Bloomberg News. He is the U.N. secretary-general’s special envoy for cities and climate change.