The two greatest challenges for American statecraft in the 21st century are becoming more severe — and seemingly pulling the United States in opposing directions.

Relations with China are deteriorating by the day, presaging a prolonged competition over the shape of global order. Meanwhile, the worsening effects of climate change — demonstrated by the shocking melting of ice in Greenland this summer — are invoking the specter of ecological catastrophe. And while dealing with the changing climate will undoubtedly require cooperation between Beijing and Washington — the world’s two largest emitters of greenhouse gases — winning the geopolitical struggle with China will require the U.S. to take a harder-edged, more competitive approach.

Statecraft is the art of reconciling the apparently irreconcilable, and the U.S. need not abandon either its environmental or its geopolitical objectives. But Washington must navigate between two bad strategies to execute the right one.

The need to balance climate-change diplomacy with sharpening geopolitical rivalry is relatively new. After the end of the Cold War, climate-change diplomacy was conducted on the assumption that the geopolitical conflicts of previous eras had receded, easing the inevitable tradeoffs created by a process that required asymmetric economic sacrifices. “Most nations worry about the same global threats,” U.S. Secretary of State Hillary Clinton said a few months before the United Nations climate-change summit in Copenhagen in 2009; the U.S. could lead by “uniting diverse partners around common concerns.” Today, by contrast, the zero-sum aspects of the U.S.-China relationship are prominent, forcing thoughtful policymakers to consider how to approach climate-change diplomacy in a more competitive world.

The Trump administration, of course, has largely dodged this challenge, by amping up confrontation with China while essentially abandoning the Paris accords and international climate-change diplomacy. But denying that a problem exists will not make it go away, and so Trump’s abdication is deferring the challenge to his successor.

At a strategic level, there are three basic options for managing the simultaneous intensification of climate change and U.S.-China rivalry.

The first (bad) idea, which flows naturally from the “America First” mentality that brought Trump to power, is that the U.S. should simply de-emphasize multilateral diplomacy on climate change. China, the thinking goes, is the world’s largest emitter of carbon dioxide. So it should not be allowed to transfer the global costs of adaptation to the U.S. by forcing Washington to make bigger, earlier cuts than China in its own greenhouse gas emissions, as stipulated in the U.S.-China bilateral agreement of 2014. More important, the long-term effects of climate change will supposedly hurt a badly polluted China more than a comparatively clean America. As climate change imposes mounting social and economic costs on China, the U.S. will reap a competitive advantage.

This approach, however, is short-sighted and wrong-headed. According to one recent study, the U.S. will actually pay a significantly higher economic price than China as climate change progresses. In fact, Beijing’s authoritarian system might prove better than America’s messy democracy at undertaking the vast engineering projects — constructing seawalls, for instance — that are needed to mitigate the effects.

This approach would also be diplomatically disastrous: Key allies, especially in Europe, will not sign up for a counter-China coalition if they perceive that Washington, rather than Beijing, is thwarting effective climate-change diplomacy. And even if the U.S. did out-compete China in a dramatically warming world, the victory would prove Pyrrhic indeed.

A second bad strategy would move to the other extreme, making geopolitical concessions in hopes of getting Beijing to cooperate on a more aggressive global program to slow climate change. The Obama administration was sometimes accused of taking this approach in the run-up to Copenhagen in 2009 and Paris in 2015, although former officials have rejected this allegation. But the basic temptation will be there, particularly for progressives who are inclined to prioritize environment over geopolitics. In this scenario, a post-Trump president might mute U.S.-Chinese disputes over Taiwan or the South China Sea as a way of getting an agreement that would commit Beijing to more aggressively curb its emissions.

Yet this strategy ignores that the Chinese government is a ruthlessly self-interested, Leninist party-state. It will address climate change — or not — based primarily on its assessment of whether doing so will bring benefits to China and the Chinese Communist Party.

This calculus probably will lead — and already has led — to greater Chinese concern with climate issues, given China’s enormous environmental problems and the high economic and social costs that a warming globe will impose on Beijing. But if the U.S. makes unrelated concessions in hopes of moving Beijing farther and faster on climate, it will simply give China’s rulers incentive to pocket those concessions while never quite delivering on climate — so that they can keep extracting more concessions. A climate-first strategy may or may not benefit the environment, but it will cost the U.S. dearly in geopolitical terms.

The question, then, is whether the U.S. can take a third route: Competing fiercely while preserving cooperation where interests align. This idea may seem counterintuitive. Yet history suggests that, while hard, is not impossible.

During the Cold War, Washington and Moscow clashed far more dangerously than Washington and Beijing are jousting today. Yet they worked together on certain shared interests. They pursued smallpox eradication programs that saved millions of lives. They joined forces to build a remarkably effective nuclear nonproliferation regime. They concluded agreements, such as the Helsinki Accords, to reduce tensions in key regions, and inked arms control treaties to limit the danger of another sort of ecological catastrophe — nuclear war.

Achieving something similar in the U.S.-China relationship would require careful balancing. U.S. officials would have to show that they will not allow China to establish linkage between climate and other issues — and to demonstrate that they will not go easy on key geopolitical disputes as the price of “improving the atmosphere” for future negotiations. Yet they would also need to keep open lines of communication on climate change even in periods of high tension, and reinforce the point — publicly and privately — that competition is some areas does not preclude collaboration in others.

This sounds obvious, but is critically important; the momentum toward rivalry can otherwise color all aspects of the relationship. It may also be helpful to preserve scientific exchanges and international forums where technical experts can meet in relatively politics-free zones, just as exchanges of arms control and disarmament experts helped lay the intellectual groundwork for certain U.S.-Soviet agreements.

Most basically, this approach requires reviving climate diplomacy as an American priority. There are legitimate critiques of the Paris agreement and other Obama-era climate initiatives. There are legitimate disagreements about how to proceed. But simply absenting the U.S. from international efforts to address climate change, as Trump has done, leaves Washington diplomatically isolated and dangerously behind the curve in dealing with a worsening problem.

To its credit, the Trump administration has shown that it is possible to reorient the American geopolitical debate on China. It will be up to Trump’s successors to show that doing so doesn’t require ignoring the other profound global threat to American well-being in the 21st century and beyond.

Hal Brands is a Bloomberg columnist and a professor at Johns Hopkins University’s School of Advanced International Studies.