IT WAS every parent's most horrifying study-abroad nightmare come true. The victim was a British student, 21-year-old Meredith Kercher, found dead in her room in the Italian university city of Perugia in 2007. Her killer, an immigrant from the Ivory Coast named Rudy Guede, was convicted in 2008 after police matched him with a handprint in Ms Kercher’s blood and multiple DNA samples retrieved at the scene. But before police had identified the evidence incriminating Mr Guede, they had also arrested Ms Kercher’s American flatmate, Amanda Knox, and Ms Knox’s Italian boyfriend, Raffaele Sollecito.

Instead of simply releasing Ms Knox and Mr Sollecito, police and a succession of prosecutors concocted a string of improbable scenarios attempting to link them to the killing as well. At first the couple were supposed to have joined Mr Guede in a satanic ritual; later it was depicted as an assisted rape that ended in murder. On March 27th, after a pre-trial hearing, a trial, two appeals and a retrial, the judges of Italy’s highest court put an end to the case and to the prolonged mental suffering of the two young defendants. The Court of Cassation in Rome found Ms Knox and Mr Sollecito not guilty on the grounds that they had “not committed the act”. Italian law recognises different levels of acquittal; this is the most categorical.

Ms Knox had risked a sentence of 28 years and six months, while Mr Sollecito faced 25 years. Each spent four years in jail before being released after their initial acquittal, in 2011. Ms Knox has been home in America ever since, fearing an Italian extradition request. She need no longer worry.

If there is a lesson to be drawn from this sorry affair it is that the Italian system of criminal justice urgently needs an overhaul. The former prime minister, Silvio Berlusconi, repeatedly said as much. But as a subject of multiple investigations himself, his personal interest in discrediting the courts vitiated his arguments and delayed change.

Italy’s criminal justice system is the product of a reform that stopped halfway. A law introduced in 1989 was meant to replace the country’s traditional inquisitorial system with an adversarial one. But it remains a clumsy mix. Of particular relevance to the Kercher affair was that the reform all but abolished discretion as to which cases should be brought to court. Whatever view is taken of the evidence—and there will always be those who believe that Ms Knox and her former boyfriend were angel-faced killers—the investigation was marked by grave irregularities. In many other systems, the case would never have gone beyond the committal stage.

Pivotal to the evidence against Ms Knox was a statement she made to police in which she said her flatmate had been killed by another African, the owner of a bar where she worked. In the statement, which she retracted soon afterwards, she said she had been in the house at the time and had covered her ears to shut out Ms Kercher’s screams. But her statement was made without access to a lawyer at 5.45am, after hours of unrecorded questioning in a language which, at that time, she barely understood—without the assistance of a professional interpreter.

The statement was ruled inadmissible in her murder trial. Yet it cropped up repeatedly as part of a suit for slander brought by the bar owner that was allowed to be joined to the murder case. Meanwhile, a central piece of evidence in the case against Mr Sollecito was a bra fastener belonging to Ms Kercher on which was found a (contested) trace of his DNA. But it was not discovered and bagged until more than seven weeks after the murder.

When will criminal justice in Italy get the reform it needs? Matteo Renzi’s government is busy with a major judicial overhaul, but of the civil-justice system, not the criminal one. It is also in a dire state, and one can understand Mr Renzi's decision to prioritise it: the civil-justice system's poor condition represents an obstacle to much-needed foreign investment in the Italian economy. The criminal-justice system, however flawed, will have to wait.