British Prime Minister David Cameron, and his wife Samantha Cameron, during a campaign visit. (Dan Kitwood/Agence France-Presse via Getty Images)

THE MOST competitive and complex British election in decades on Thursday may lead to weeks or months of uncertainty about the country’s leadership, with both the incumbent Conservative and opposition Labor parties scrambling to assemble coalitions. For the United States, however, the overarching result is already clear: A stalwart U.S. ally is growing weaker, more inwardly focused and less willing or able to join in common endeavors.

Britain’s retreat has gathered momentum during the five-year term of Conservative Prime Minister David Cameron, who has brought the country back from deep recession and near insolvency, but at the price of deep cuts in its armed forces and its global ambitions. By one account, the British army may soon shrink to its smallest size since the American Revolution, and defense spending appears set to slip below the NATO benchmark of 2 percent of gross domestic product. More reductions appear inevitable regardless of who wins the election.

In 2013, Mr. Cameron was rebuffed when he sought parliament’s approval to join the United States in airstrikes against the Syrian regime of Bashar al-Assad. Since then his government has been a virtual spectator in the Ukraine crisis and played only a minor role in the U.S.-led campaign against the Islamic State. Challenger Ed Miliband of the Labor Party has criticized this abdication, calling it “pessimistic isolationism.” But as evidence of his own resoluteness, Mr. Miliband cites his willingness to stand up not against Mr. Assad or Vladi­mir Putin, but President Obama. He has repudiated the centrist policies of former Labor leader Tony Blair, whose robust support for the wars in Afghanistan and Iraq produced a backlash that has done much to create the current political climate.

Deadlocked in the polls with about a third of the vote each, neither Mr. Cameron nor Mr. Miliband appears capable of forming a strong government; both will have to rely on support from small parties. A new Cameron government would be consumed, in foreign policy, by the prime minister’s promise to renegotiate Britain’s place in the European Union and hold a referendum on whether to remain in it by 2017; withdrawal would devalue what remains of Britain’s global standing. Mr. Miliband would almost certainly have to rely for support on the Scottish National Party, which favors nuclear disarmament and remains committed to the breakup of the United Kingdom through an independent Scotland.

As a practical matter, the Obama administration already has learned to rely less on what has long been known as the “special relationship” between London and Washington; Germany’s Angela Merkel has been a better partner to Mr. Obama, who has done little to cultivate relations with Mr. Cameron or most other foreign leaders. It can be expected that Mr. Obama’s successor, whether Democrat or Republican, will take office with the intention of reviving traditional U.S. leadership and alliances. But under either Mr. Cameron or Mr. Miliband, the U.S. partnership with Britain may prove hard to resuscitate.