Mr. Obama not only adapted to the shape of Middle Eastern power politics, but he also largely overlooked human rights abuses by Saudi Arabia, Israel, Egypt and other allies. The Bush administration’s patronizing rhetoric of democracy promotion was shelved, but this came at the cost of reducing American concerns in the Middle East to terrorism and national security.

In a speech to the Turkish Parliament in 2009, Mr. Obama promised that “America’s relationship with the Muslim community, the Muslim world cannot, and will not, just be based on opposition to terrorism.” Yet that is precisely what happened, even if the “war on terror” was decorously renamed the “fight to counter violent extremism.” The war was based on Special Operations and drone strikes rather than torture and ground invasions, but it, too, was subject to few restraints, and eventually it came to cover a much greater land mass. Styling himself as an anti-terrorist commander, Mr. Obama buried the legalistic multilateralism that he had taught at Harvard. While the drone program began under Mr. Bush, Mr. Obama substantially expanded it. Armed with a “kill list” and the Predator joystick, he could eliminate America’s enemies, while avoiding land wars — or public scrutiny.

Mr. Bush’s occupations provoked liberal outrage; Mr. Obama’s drone war emitted a kind of white noise that most Americans ignored. But the killing of people by drones or Special Operations was not unnoticed in Yemen, Somalia and Pakistan or other countries, and did little to win local hearts and minds. In fact, his determination to avoid American casualties, even as he expanded the battlefield, reinforced the impression that for all his talk of cooperation and partnership, he was a pitiless realist.

That realism was at its most glacial in the case of Syria’s civil war. Chastened by the results of NATO’s intervention in Libya, where a dictator was replaced by militia rule and jihadist violence, and always a reluctant humanitarian, Mr. Obama understood that the Syrian war was as much a sequel to the bloody sectarian struggle inside Iraq as it was the latest installment of the Arab Spring. He drew a cold but defensible conclusion: The growth of the Islamic State was a direct threat to American interests that merited a military response, but President Bashar al-Assad was not. Intervention against Mr. Assad would lead to clashes with Russia, for whom Syria was a core interest.

At first glance, the twists and turns of Mr. Obama’s Syria policy made the president seem indecisive, if not incoherent: calling for Mr. Assad to step down without taking direct action against him, even after the regime’s use of chemical weapons in defiance of Mr. Obama’s “red line”; attacking the jihadists of the Islamic State while allies like Turkey and Qatar supported other extremist groups; opposing Russian designs and then coordinating airstrikes with Moscow. But the aim of keeping American troops out of Syria was consistent. At his final news conference as president, Mr. Obama expressed anguish over the fall of Aleppo, but insisted that his Syria policy had been guided by his sense of “what’s the right thing to do for America.”

It may well have been; American lives were spared. But noninterference created a vacuum that autocrats like President Vladimir V. Putin of Russia and Recep Tayyip Erdogan of Turkey were happy to fill. What’s more, Mr. Obama’s understanding of American interests in Syria was more restrictively drawn than one might have expected from a man so worldly, someone who had always stressed the interdependence of the global community and the moral burdens of “what it means to share this world in the 21st century.” Who governs Syria may not be a core American interest, but the country’s apocalyptic splintering is another matter. The effect of Mr. Obama’s caution, as much as Moscow’s belligerent resolve, was to help prolong the war.

The consequences of Syria’s disintegration have spread far beyond its borders. Not only has the crisis placed dangerous strains on neighboring states, but it has emboldened the far right in Europe, which has played on fears about Islam and terrorism in its campaign against immigration and the European Union. Nor has the United States been unscathed by what Mr. Obama recently called the “tug of tribalism”: Donald J. Trump owes his election to it. Mr. Trump is an open admirer of tribal politicians like Mr. Putin, Mr. Erdogan and Prime Minister Benjamin Netanyahu of Israel, not least because they remind him of himself with their love of the mob, contempt for liberal elites and penchant for conspiracy theory.

In his 2009 speech in Cairo, Mr. Obama imagined Muslim and Western democrats working together in partnership, overcoming borders imposed by war, prejudice and mistrust for the sake of a common future. Instead, the very prospect of a common future, of global interdependence, has been jeopardized by the emergence of an illiberal world of tribes without flags. Despite the best of intentions, and for all his fine words, Mr. Obama became one of the midwives of this dangerous and angry new world, where his enlightened cosmopolitanism increasingly looks like an anachronism.