President Obama shakes hands with Vietnam President Tran Dai Quang. (Kevin Lamarque/Reuters)

TO THE extent the divided American electorate can be said to agree on anything after Nov. 8, it would seem to be broad rejection of “trade deals” such as the Trans-Pacific Partnership (TPP). Both major-party candidates, Republican winner Donald Trump and Democratic loser Hillary Clinton — as well as her erstwhile primary opponent, Sen. Bernie Sanders (I-Vt.) — opposed it. Not surprisingly, the Senate will not take up the TPP in the lame-duck session.

Therefore, there was a certain pathos to President Obama’s valedictory performance at last weekend’s Asia-Pacific economic summit. With Mr. Trump, the most vehement protectionist to win the presidency in recent memory, preparing to take over at the White House on Jan. 20, Mr. Obama urged the region’s leaders not to give up on the TPP or the American presence in Asia that it would embody and perpetuate. Meanwhile, China’s strongman, Xi Jinping, offered membership in its alternative to the TPP, the Regional Comprehensive Economic Partnership, a less ambitious tariff-cutting plan whose main impact would be to substitute Beijing for Washington as the Asia-Pacific region’s economic and, potentially, strategic heavyweight.

Abandoning the TPP would be a self-inflicted injury to the United States and its democratic partners, from the west coast of South America to Australia to Japan. Yet even as the various leaders of those nations declared themselves open to China’s blandishments, they refused to close the door on some new arrangement that might include the United States. New Zealand’s prime minister, John Key, observed that he would consider renaming the TPP the “Trump Pacific Partnership” if it would help bring the new American administration on board; while Mr. Key was obviously joking, his offer to reopen negotiations in search of a bargain that would meet with Washington’s approval seemed genuine enough. Surely no nation in this prosperous, strategically vital area of the world can relish its abandonment by the United States, after 70 years in which the area benefited from American investment, trade and military strength.

Unfortunately, there is every indication that Mr. Trump’s opposition to trade agreements and, indeed, to free trade itself is deep-seated, not a position he adopted for transitory political purposes. Doubly unfortunately, he is surrounding himself with advisers, notably future White House political adviser Stephen K. Bannon, who relish the label “nationalist” and may see engagement with Asia as part of the “globalist” paradigm Mr. Trump was elected to undo. In a brief video statement Mr. Trump released Monday, he reiterated his intention to jettison the TPP.

The president-elect also said he would seek new “fair, bilateral” deals. We hope that represents an opening to maintaining U.S. leadership in the Pacific region. Everything the would-be TPP partners said at the summit suggests that they would welcome such a U.S. role. If Mr. Trump wants to avoid going down in history as author of one of the most short-sighted diplomatic errors for the United States since the rejection of the League of Nations, he will not compound the mistake of withdrawing from the TPP by also withdrawing the United States from a role that has kept the peace and promoted prosperity for so long.