By Mark Urban
Diplomatic editor, BBC Newsnight
How much more difficult could a relationship be?
The leaked report has embarrassed the British government
British troops are being killed in Afghanistan and the Pakistani army could make a difference.
The head of the Pakistani military is also the president, by virtue of a coup. Both Britain and the United States, however, wish to foster democracy rather than having a general in charge.
Add to this conundrum the fact that Pakistan has nuclear weapons, Islamic militancy is surging and anything resembling a collapse of order could trigger regional meltdown, and the picture is complete.
In June, a small delegation from Britain's Defence Academy travelled around Pakistan, meeting academics, military officers and politicians. Their discussions about how the country might emerge from its current time of troubles naturally touched on many sensitive areas.
It is a measure of how difficult Anglo-Pakistani relations have become that even the research of an officer on an academic posting could have such an effect
When they got back to their offices at Shrivenham in Wiltshire one of the team, an officer on attachment to the academy who had previously served in a sensitive post liaising with the Americans on counter-terrorist matters, set down the team's findings.
The document, several pages long, runs through the "fix" that President Pervez Musharraf is in - trying to square international pressures with rising Islamic sentiment - before looking at the Western, Afghan, US and UK dilemmas.
"Pakistan is existing on the edge of chaos," he writes, arguing that Gen Musharraf does not stand for stability but rather that a move to civilian rule "might in fact be the only way to retain and improve stability, avoiding collapse and anarchy".
'Against UK interests'
Many of the statements contained in the officer's notes, for example that the war in Iraq has not gone well and has served as a "recruiting sergeant" for extremists, are in line with other recently published assessments.
The report said the Iraq war had radicalised disillusioned youth
However, in some areas the Defence Academy's paper is quite opposed to Downing Street's world view, suggesting that "the UK has followed US policies on the global war on terror at the perceived exclusion of its own interests".
The officer suggests the Pentagon lacks a strategic big idea and that "the US/UK cannot begin to turn the tide until they identify the real enemies... and seek to put in place a better and more just vision".
Unfortunately for the taxpayers and senior officers who sent him away to Shrivenham on a posting for study and professional improvement, the writer does not suggest what that larger vision of prosecuting these conflicts might be.
Instead, he argues that British forces in Iraq "are effectively being held hostage... we are now fighting (and arguably losing or potentially losing) on two fronts".
It is, though, the reflections on Pakistani politics that proved so embarrassing for the British government on the eve of Gen Musharraf's visit.
Western nations are urging a return to civilian rule in Pakistan
The British officer considers 2007 to be "the crunch year", in which international pressure for a move to civilian rule will collide with the Pakistani military's attempts to retain control of the country through their Inter-Services Intelligence (ISI) and political proxies.
Many Pakistani commentators have long suggested that the ISI has been used to maintain the system of military rule by exporting Islamic militancy to Kashmir and Afghanistan.
"Indirectly", the British officer agrees, "Pakistan (through the ISI) has been supporting terrorism and extremism." He suggests that the Americans are fed up with this state of affairs and may withdraw their funding in order to chase Gen Musharraf from office.
Statements of this kind ultimately proved too tempting for someone with access to the Defence Academy's work to resist.
The officer's notes were not classified and were held on a common computer server, allowing many staff open access.
One official at the Ministry of Defence suggested that one reader decided to leak the contents in order to embarrass the Pakistani leader.
It is a measure of how difficult Anglo-Pakistani relations have become that even the research of an officer on an academic posting could have such an effect.