Sometimes judges can be street-smart clever. The recent pas de deux between the top European human rights court and the UK Supreme Court in Al-Khawaja is a good example.

To understand the shrewdness of the judgment in this case, you need to understand the background. This is set by David Cameron. The prime minister increasingly reveals a coherent, if risky, constitutional strategy – not attractive in total to pro-Europeans such as Ken Clarke. Lure Alex Salmond out into open ground and defeat Scottish nationalism; see off the European Court of Human Rights (ECtHR); loosen ties with the EU; enhance the powers of parliament; and strengthen the UK government.

In this strategy, it is helpful to the grand plan if the ECtHR in particular, and the global claims of human rights in general, can be marginalised. Thus, decisions of the European court that can be portrayed as outrageous are useful. This is the context into which walked a sleazy doctor from Brighton, Dr Al-Khawaja. He was convicted of sexual assault on two women that he had placed under hypnosis.

No human rights point was taken at Al-Khawaja’s trial but, on appeal, someone got up to speed. One of his convictions was unassailable but one was vulnerable. The alleged victim had died after giving a written statement to the police but before trial. Her words would, in principle, have been excluded by the rule against hearsay. However, the judge allowed them under provisions in the Criminal Justice Act 2003, Tony Blair’s boasted attempt to ‘rebalance’ the criminal justice system. This set up a confrontation with the ECtHR which, for some time, has held that the right to a fair trial in article 6 of the European Convention on Human Rights requires that the suspect has the right to confront an accuser. Hearsay evidence must not be the ‘sole or decisive’ reason for a conviction.

On the facts, the case for Al-Khawaja was unattractive. The victim had immediately reported her distress at the incident to two of her helpers; repeated her complaint when contacted by the police; and made a written statement accusing the doctor of sexual abuse. She committed suicide before the trial. The other victim gave evidence of similar conduct by the doctor and was cross-examined before the jury. Al-Khawaja was convicted in both cases and got a sentence of, in total, 27 months’ imprisonment. The case in relation to the deceased victim turned on the admissibility of what she had told the police. As the judge remarked, ‘putting it bluntly, no statement, no count one’.

The defence appealed to the Court of Appeal and the House of Lords on the basis that the ECtHR took a hard line on excluding hearsay evidence since the defendant had no chance to cross-examine his accuser. Neither court was much impressed. Their view was no doubt reinforced by the clear provisions of English statute and a defendant convicted, in any event, on another count for pretty much the same crime.

Enter the European court – twice. The first intervention was a straightforward rebuff. The court held to the ‘sole and decisive’ line. However, there then occurred what, intriguingly, might just have been a choreographed movement between the UK Supreme Court and the Ministry of Justice with the aim of heading off a potential confrontation unhelpful to those who fundamentally support the role of the ECtHR. The Supreme Court seized on another case, Horncastle, on hearsay and delivered a pretty devastating critique of the European court’s jurisprudence. It demanded reconsideration by the court. The government, for its part, exercised its right to refer the initial judgment in Al-Khawaja to the Grand Chamber of the court to give it a chance to do so.

So, the challenge was down. Would the European court be browbeaten by the British, whose justice ministers and judges were singing from a common hymn sheet? Or would it stand up for the broad-brush approach to principle traditionally taken by the court? It is fair to say that the Supreme Court’s judgment in Horncastle was a snorter. Led by Lord Phillips, the court traces and attacks the growth of the ‘sole or decisive’ argument as arising in the ECtHR’s judgments without explanation and repeated without examination. ‘We are all judges’ was the subtext in a call to the ECtHR, ‘don’t lead us into a battle with the politicians on this one’. All sorts of rumours emanated from Strasbourg. The European judges, it was said, were not going to be pushed around. They would stick to their principles. They were fed up with sneering by stuck-up Brits.

The judgment, in the end, was heavy with the emollient fingerprints of Sir Nicolas Bratza, then the British vice-president of the court. He popped up at the end of the main judgment to say what a good example this was of ‘judicial dialogue’. The court reasserted the importance of a fair trial and the right to cross-examine a witness. However, the crucial thing was the fairness of the trial overall and, on the particular facts, Al-Khawaja was rightly convicted. By contrast, another defendant, with whom Al-Khawaja’s case was heard, was not. There, the judge allowed the jury to hear a statement by a witness who could have testified orally but declined to do so.

Thus, we end with a classic, very clever and very reasonable judicial compromise – assertion of an important principle, mitigation of effect. At the end of it, the two courts could congratulate themselves. As to the constitution, the struggle continues. As to hearsay, the prosecution should take care.

Roger Smith is director of the law reform and human rights organisation Justice