On Friday morning, in Palermo, Sicily, security officers locked a young Eritrean man in a cell in the back of Italy’s most secure judicial facility. Known as the Bunker, the courtroom at Ucciardone prison was built in the nineteen-eighties to hold the largest Mafia trial in history: four hundred and seventy-five members of the Cosa Nostra, charged with an array of crimes including extortion, drug trafficking, and scores of murders. Now, in a room the size of half a stadium—lined with thirty cells and secured by twenty-foot-high walls, bulletproof glass, and a roof that had been designed to withstand attacks from rocket-propelled grenades—sat a solitary defendant, grabbing the bars, crying into a handkerchief, chewing on his cuticles, rocking back and forth, holding his head in his hands.

For three years, the central question of Italy’s highest-profile migration case, against the smuggler Medhanie Yehdego Mered—who presided over a complex criminal enterprise that spanned eleven countries and three continents, and involved numerous accomplices, the trafficking of thousands of migrants, and millions of euros in illicit profits—has not been the quality or volume of evidence against him but whether the man that prosecutors had in custody was, in fact, Mered. As I wrote in The New Yorker, in 2017, the defendant appeared instead to be a refugee named Medhanie Tesfamariam Berhe, a former milk salesman whose only shared attributes with Mered were his nationality and his first name. Hundreds of Eritreans—including Berhe’s family members and Mered’s wife, brother, and former clients—have come forward to say that the wrong man is in custody. Documents from Eritrea have proved that Berhe and Mered are distinct people, and DNA tests have confirmed that the man in custody is related to Berhe’s mother and not to Mered’s son. After I met Mered’s wife, in Sweden, she persuaded Mered to call me, from Uganda, where he has been living under a false identity for several years. “These European governments—their technology is so good, but they know nothing,” he told me. He added that, although he felt sorry for Berhe, he was not about to turn himself in. Meanwhile, no government has issued an arrest warrant for Mered, because he is officially considered to be in Italian custody.

Nevertheless, at every stage, the lead prosecutor, Calogero Ferrara, has insisted on the integrity of the proceedings, while obscuring evidence, blocking exculpatory testimonies, and using the investigative powers that were accorded his office to defeat the Mafia in order to intimidate his critics. He opened investigations into Eritreans who spoke to Berhe’s innocence and Mered’s guilt, arguing that they were part of a vast conspiracy to spring one of East Africa’s most powerful smugglers from jail. His office also intercepted phone calls between Eritreans and Lorenzo Tondo, a Sicilian journalist who relentlessly pursued the case for the Guardian, and insinuated that Tondo and other journalists were incompetent and had been tricked by the Eritreans into publishing lies. Meanwhile, Ferrara and his team continued to investigate Mered’s supposed associates, mostly through wiretaps (prosecutors have not produced a single witness who says that the man in custody is Mered), and eventually filed human-trafficking charges against a suspect in absentia who appeared in intercepted messages only as “Mesi.” When Jerusalem Gebreyesus, the defense team’s Eritrean interpreter, reviewed the documents, he realized that “Mesi” appeared to be not a person but a misspelling of the Tigrinya word for “when.” (Other interpreters came to the same conclusion.) Soon afterward, transcripts of Gebreyesus’s phone calls were entered into evidence, too.

“This is an international embarrassment,” Michele Calantropo, Berhe’s lawyer, said on July 1st, during his closing remarks, a four-hour oration before a mostly empty room. He gestured to a screen displaying “The Treachery of Images,” a surrealist work from 1929, by the artist René Magritte: below a painting of a large wooden pipe, Magritte wrote, in elegant cursive, “Ceci n’est pas une pipe.” “This is not a pipe,” Calantropo said, throwing his arms up dramatically. He changed slides to a photo of the man whom the prosecutors had correctly identified as Mered, and who was clearly not the one in the back of the room. “Et ceci n’est pas un trafiquant?”

On Friday morning, Ferrara stood up in court and tried unsuccessfully to enter into evidence documents that the presiding judge, Alfredo Montalto, had previously rejected. Behind him, in a public viewing area, sat five Eritreans with no relation to Mered, including Berhe’s sister Hiwet, who had travelled from Norway for the verdict. (In 2016, she had tried to visit Berhe in prison, but was refused access because only family members are allowed visits, and Berhe was mistakenly registered as Mered.) After Ferrara had finished representing the Italian state, he sat down, opened his prosecutorial robes, and started fanning himself with a stack of papers. Montalto ordered a break for jury deliberations, and returned to the bench four hours later, to read out the verdict. (Ferrara had requested that the defendant, whatever his name, serve fourteen years in prison.)

For nearly ten minutes, Montalto mumbled through the charges and the Italian penal code, standing over a microphone that hardly picked up his voice. Berhe stood in his cell, dressed in a green shirt and bluejeans, unable to understand the words deciding his fate. Even the court interpreter, Abraha Tewolde, strained to follow the sentence. But Montalto ruled that it was “a case of mistaken identity,” and, although he found Berhe guilty of having helped two people (including “Mesi”) illegally cross into Libya, ordered Berhe’s immediate release. Afterward, “through tears of happiness,” Tewolde told me, “I turned to Berhe and I told him, ‘You’re free.’ ”