Just when the justice secretary could do with a stick to beat the European court of human rights, it delivers two judgments in the government’s favour and refuses an appeal against the government in a third. Chris Grayling must be gnashing his teeth.

The first unsuccessful claim, brought by the would-be London bombers and an accomplice over the delay in allowing them legal advice, is well covered by Owen Bowcott. This piece is about the second government victory and the public dialogue on hearsay evidence between the human rights court in Strasbourg and the supreme court in London.

Our story begins in May 2005 when Peter Rice, an alcoholic, was badly beaten at his flat in Birkenhead. He recovered in hospital and was able to make a statement to the police a month later. He died of an alcohol-related illness just over a year later.

Michael Horncastle, 34, and David Blackmore, 33, were charged with causing Rice grievous bodily harm with intent. Since Rice had died before their trial, the police wanted to read his statement to the jury. The judge agreed. There was also supporting evidence. Horncastle and Blackmore were convicted in 2007 and imprisoned.

While they were on trial for an unrelated incident, six burglars broke into a house in Nottingham. It was 7pm. Gary Price, who lived there, was out but his partner, Hannah Miles, was at home. After threatening her with a knife, the burglars kidnapped Miles. She was later released unharmed.

Miles and Price made short statements to the police which they later tried to retract. Miles said she had been very frightened of what the kidnappers might do to her. Price feared reprisals. Neither Miles not Price attended court when ordered to do so, though they risked imprisonment for contempt. So the judge allowed Miles’s statement to be read to the jury. Again, there was other evidence.

In May 2008, Abijah Marquis, 36, and Joseph Graham, 33, were convicted of kidnapping Miles and imprisoned.

In 2009, all four men appealed against their convictions on the grounds that their alleged victim’s written statement should not have been admitted. English law normally requires evidence in person from a witness who speaks from his or her own observation or knowledge. Secondhand evidence – given by a person to whom the absent witness has spoken or in a document created by the missing witness – is known as hearsay. That can be admitted only if it comes within exceptions in the Criminal Justice Act 2003. The legislation includes important safeguards designed to ensure a fair trial.

The men’s appeal was based on article 6 of the human rights convention, the right to a fair trial, which includes the right to examine prosecution witnesses. They relied on a ruling that the human rights court had delivered a couple of months earlier. In Al-Khawaja and Tahery v UK, a chamber of the court had ruled that article 6 would be breached if a conviction had been based solely or decisively on statements that a defendant had received no opportunity of challenging.

That looked like a problem for the court of appeal. Under the Human Rights Act 1998, courts are required to take rulings by the Strasbourg court into account. But a five-judge appeal court led by the present lord chief justice was able to find that there had been no breach of article 6. Putting it politely, the judges were saying that European court had misunderstood English hearsay law. Since the Strasbourg judges had got Al-Khawaja wrong, the English court dismissed the four men’s appeals.

That was in May 2009. A couple of months later, the men appealed to the UK’s highest court. And in December 2009, the supreme court agreed with the court of appeal.

Speaking for a unanimous court, Lord Phillips, the president, recalled that exceptions to the hearsay rule had been approved by parliament. “The requirement to ‘take into account’ the Strasbourg jurisprudence will normally result in this court applying principles that are clearly established by the Strasbourg court,” Phillips acknowledged.

“There will, however, be rare occasions where this court has concerns as to whether a decision of the Strasbourg court sufficiently appreciates or accommodates particular aspects of our domestic process. In such circumstances it is open to this court to decline to follow the Strasbourg decision, giving reasons for adopting this course.

“This is likely to give the Strasbourg court the opportunity to reconsider the particular aspect of the decision that is in issue, so that there takes place what may prove to be a valuable dialogue between this court and the Strasbourg court. This is such a case.”

That dialogue involved two stages. First, the government lodged what amounted to an appeal against the Al-Khawaja judgment. In December 2011, the court’s grand chamber modified its earlier ruling.

The Strasbourg judges agreed with their British counterparts that a conviction based solely or decisively on the statement of an absent witness would not automatically result in a breach of article 6. However, there would still a breach of the defendant’s rights unless there were counterbalancing factors, including strong procedural safeguards, to compensate for the difficulties caused to the defence and the dangers of relying on hearsay evidence.

But that left open the question of whether there was a breach of article 6 in the Horncastle and Marquis cases, as there had been in one of the two cases covered by the Al-Khawaja ruling (that of Tahery). We now have the Strasbourg chamber decision applying Al-Khawaja to the facts of these cases.

In the Horncastle case, the court concluded it was “more than arguable”, in the light of other incriminating evidence, that Rice’s statement was not decisive in the sense that it determined the outcome of the case. And even if it was “there were sufficient counterbalancing factors to compensate for any difficulties caused to the defence by the admission of the statement”. So there was no breach of article 6.

In the Marquis case, the Strasbourg judges were satisfied there was good reason for Miles’s failure to attend court and give evidence. The trial judge had found she was “petrified, genuinely in distress”. Moreover, “in light of the other strong incriminating evidence in the case, it cannot be said that [her] statement was of such significance or importance as to be likely to determine the outcome of the case against the applicants. Her statement was therefore neither the sole nor the decisive basis of the applicants’ convictions.”

So there was no need to consider whether there were sufficient counterbalancing factors. Once again, the judges were unanimous: there was no breach of the human rights convention.

These rulings, though not surprising, are clearly just. But the Horncastle dialogue has a deeper lesson for justice secretary and other Conservatives who argue that the Strasbourg court’s rulings should be advisory rather than binding.

Sure, there is no “democratic override” – no parliament can overturn the decisions of the court’s grand chamber – but the European court, like any other institution, is capable of getting things wrong. And, when it is persuaded that it has made a mistake, it is not too grand to think again.

Crucially, it was persuaded to do so in this case by the careful reasoning of the court of appeal and the supreme court. That’s what the court would lose if the UK pulled out of the human rights convention.

And just in case the message is not clear, the court has just refused to reopen the vexed question of prisoners voting. Its decision in August refusing damages or even costs to disenfranchised prisoners (though confirming a rights violation) is now final. So this issue has been parked until after the general election. Though prisoners will not have a say, Strasbourg will be watching the voting with interest.