Duterte’s rhetorical whiplash might have seemed like another example of his mercurial—or, as he calls it, “bipolar”—nature. But while the former mayor might be combative, violent, and constantly offensive, those who know him say he is shrewd. A few hours after Duterte flattered the ExxonMobil CEO-turned-diplomat, NBC News reported, citing two defense officials, that the Pentagon was considering airstrikes to aid the Philippine army’s fight against Filipino militants allied with the Islamic State. Filipino officials denied the report, but U.S. generals have been talking about a potential operation for months. The Americans also recently gave the Filipinos surveillance planes, and U.S. special forces are on the ground in Mindanao as advisors.

Duterte’s lessons in living history are just as strategic. Following his July outburst, U.S. news outlets struggled to interpret his reference to America’s “past sins.” But Filipinos knew what he meant. Though Americans have spent a century trying to forget it, the United States’s path to global power began in the Philippines in 1898, when, on the eve of their joint victory in the Spanish-American War, President William McKinley betrayed his Filipino allies, ignored their declaration of independence, and launched his own annexation campaign of the archipelago.

Filipinos fought back. The resulting Philippine-American War left about 4,000 U.S. soldiers and more than 220,000 Filipinos dead. That conflict, and the early counterinsurgency operations that followed, were marked by American massacres of civilians, torture (including the first American experiments in waterboarding), and other atrocities. Despite stateside opposition to the widening imperial project—which soon grew to encompass other Pacific islands, parts of China, Latin America, and the Caribbean—U.S. administrations continued ruling over the Philippines until the 1940s, with American governors-general living in the Malacañan.

The U.S. colonization of the Philippines transformed both countries in language, culture, and politics. It ended only after much of the archipelago’s infrastructure and cities were destroyed in World War II—a conflict whose Pacific component the U.S. domination of the Philippines helped provoke in the first place.

For decades since, Filipino leaders avoided talking about the atrocities America would rather forget. The colonial relationship, and particularly the U.S. alliance that ended the far briefer and more vicious Japanese occupation of the 1940s, had forged a close strategic bond. And besides, as long as the U.S. remained the most powerful force in the neighborhood, there was little point in reminding them they had once been mortal enemies.

But now another power is emerging closer to the Philippines’s shores. China is projecting force for the first time in modern history, with bold moves into the South China Sea, which separates the Chinese mainland from the Philippines. The Chinese People’s Liberation Army has built up several uninhabited islands in the sea into bases with airstrips, radar, and antiaircraft guns. Duterte has been forced to flirt with the possibility of armed conflict with his huge, nuclear-armed neighbor over the Spratlys, a set of uninhabited glorified rocks that belong to the Philippines and Vietnam, but whose fishing, oil, commercial sea-lane, and military potential have led China to claim them as their own.