NEW YORK — The former U.S. ambassador to Ottawa under the Obama administration on Tuesday supported Canada’s candidacy for a rotating membership on the United Nations Security Council, saying it is vital for Ottawa to be represented on the panel if President Trump wins reelection.

In unusually barbed remarks by a former ambassador to a foreign audience, Bruce Heyman gave a speech to Canadian law students that was centered on his belief that Trump is a threat to the U.S. Constitution and cannot be trusted to uphold democratic values.

Numerous ambassadors in place during the Obama administration quit in protest of Trump’s policies and wrote opinion pieces for newspapers and websites explaining their rationale. But it is extremely rare that they would air their harshest critiques in a public speech before a foreign audience. Heyman said he considered it his duty as part of his oath of office to uphold and defend the nation’s founding document.

“For me, today, when the U.N. General Assembly is all together, a Canadian seat on the U.N. Security Council is more important than ever,” Heyman said at the law school of Western University in London, Ontario.

“The world’s losing its defenders of [the] liberal democratic order of things. And I believe this increases the importance of having Canada’s seat on the Security Council. But it probably makes it harder, [with] President Trump being more transactional in supporting who gets the seat. Canada, are you willing to transact?”

Ottawa has been campaigning for a two-year membership on the Security Council beginning in 2021, for which the election will be held next year. The last time Canada held a Security Council seat was in 1999.

Heyman is a former senior Goldman Sachs executive from Chicago who served as President Barack Obama’s envoy to Canada from 2014 to 2017. He remains interested in U.S.-Canadian affairs and returns to Canada regularly to give speeches and explain the United States to Canadian audiences.

Heyman was replaced in Ottawa by Trump nominee Kelly Craft, who was later nominated to be the U.S. ambassador to the United Nations. Craft was sworn in earlier this month and is making her introductory appearance during the U.N. General Assembly underway this week.

Heyman acknowledged he plans to work hard for Trump’s defeat in the 2020 election, using fire analogies to describe a possible second Trump term. At one point he advised Canadians to look for the fire exits, as if in a fire drill.

In criticizing the Trump administration’s aggressive use of sanctions against Iran, Heyman said it was to be expected that Iran would “punch back” in retaliation. U.S. military and national security officials, including Secretary of State Mike Pompeo, have blamed Iran for attacks on oil tankers in the Persian Gulf and on Saudi oil refineries.

“I think we’re playing a very dangerous game right now,” he said. “Very, very dangerous. It’s like a president who’s flicking matches in dry woods. Is it going to catch fire? I don’t know. But it’s getting more dangerous as the days go on.”

Heyman said there had been a “breakdown in trust” between the Trump administration and institutions in the United States and other countries.

“That’s what happens when one party plays by their own set of rules, but yet expects you to respect the law,” he said.

Heyman acknowledged his criticism was strong, and something he previously thought “I never would have done in a post-ambassadorial role.”

“When I swore in to preserve and protect the Constitution of the United States against enemies foreign and domestic, when my term is over as an ambassador, you don’t, like, swear out,” he said.

“I feel that I am today still under that oath,” he added. “And I feel some of the things, and many things [Trump] is doing and saying, and the way he is operating is a threat to the Constitution of the United States of America. And thus I am taking a perhaps significantly bolder step than a former ambassador would ever take.”