British Prime Minister David Cameron leaves 10 Downing Street in London on Monday. (Matt Dunham/Associated Press)

UNDER DAVID Cameron’s leadership, Britain’s importance as a U.S. ally has steadily diminished. His government was slow in joining the campaign against the Islamic State and has played no significant role in resisting Russian aggression in Ukraine. Following a rebuff by Parliament, Mr. Cameron retreated from airstrikes against Syria in 2013, prompting a climbdown by President Obama that has had disastrous consequences. Mr. Cameron’s most notable foreign policy initiative was his craven courtship of Chinese dictator Xi Jinping in the hope of reaping commercial advantage.

Consequently, the result of Mr. Cameron’s last and most calamitous misstep, the promotion of an unnecessary referendum on Britain’s membership in the European Union, should logically lead to an acceleration of an existing trend in U.S. foreign relations, rather than an abrupt shift. As it already has, the Obama administration will look more to Germany for help and leadership on transatlantic security issues, while cultivating stronger strategic relations with Asian partners such as India and Japan. It should not expect much help from London in managing new crises in the Middle East and elsewhere in the coming years — but then, that was already pretty much the case.

How much further the “special relationship” between the United States and Britain will be devalued will depend on what now looks like a very unpredictable course of events in London. The government that succeeds that of Mr. Cameron in the coming months will almost certainly have to choose between satisfying promises of restricted immigration and curtailed payments to the E.U. and keeping Britain’s current access to the unified European market. If it chooses the latter, Britain’s role in Europe and its economic clout may not ultimately diminish that much.

The uncertainty means that neither the Obama administration nor Mr. Obama’s successor should rush to forge a new economic or political relationship with a presumably non-E.U. Britain. Some of the pro-Brexit camp have talked of arranging a separate free-trade agreement with the United States, outside the U.S.-E.U. trade pact now under negotiation, or even joining NAFTA. But any consideration of such deals should await Britain’s final settlement with the E.U., which will take up to two years from the time it provides notice of its departure.

In the meantime, the United States can best support Britain, and Europe, by becoming a more active and vocal leader of the NATO alliance, which will retain Britain as a member. If the European Union is weakening or even in danger of crumbling, to the delight of Vladi­mir Putin, Mr. Xi and other adversaries, then one antidote is a reinforced transatlantic military partnership that bridges the incipient gap between London and the continent. NATO’s next summit meeting is scheduled for next month in Warsaw, where it is expected to confirm an important new deployment of forces to Eastern European countries bordering Russia. Mr. Obama should take the occasion to reconfirm U.S. commitment to NATO — and presidential candidates Hillary Clinton and Donald Trump should be judged on whether they do the same.