Another longtime US ally just went off the reservation, in what’s become a depressing trend of the late Obama years.

Don’t get us wrong: Philippines President Rodrigo Duterte is a nightmare. His promotion of vigilante justice against drug dealers has already cost thousands of lives — some of them surely innocent.

But now he’s gone to China — announcing this week that he would formally align his nation with Beijing. Only time will tell if he’s truly breaking a decades-long alliance with Washington, which would upend the entire US position in the Pacific.

Beijing certainly won’t care about his human-rights violations — or any move he makes to undermine Filipino democracy.

This follows a growing break with Turkey, thanks to another peach of a world leader, Recep Tayyip Erdogan.

In the wake of the recent failed coup attempt, the Turkish president is crushing his nation’s last vestiges of a free press and purging the courts, police and pretty much everything else of anyone who might challenge his Islamist clique for power.

He’s also gone to war against the Syrian Kurds who’ve been the leaders of the fight against ISIS in that country — Kurds who have had the support of Washington and other NATO allies.

Yet he’s also insisting on fighting ISIS on another front, with Turkish troops in Iraq that he demands play a role in the battle to free Mosul from ISIS.

Few other US allies have gone as rogue as Duterte or Erdogan. But many — especially the Saudis and other Gulf monarchs — are increasingly going their own way.

Even Israel has found it necessary to maintain good-as-possible relations with Vladimir Putin’s Russia.

It’s all the predictable result of President Obama’s penchant for “leading from behind”: Allies who can’t be sure America will stay loyal to them don’t stay loyal to America. And US rivals and enemies feel emboldened.

As John Podhoretz warned in these pages back in 2011, Obama’s approach has invited “military, strategic and economic challenges” all around the globe.

The next president will inherit the mess.