BEIJING (Reuters) - China’s highest legal body on Friday exonerated a 21-year-old man executed in 1995 following a conviction of rape and murder, saying the evidence against him had been insufficient.

Nie Shubin was found guilty 21 years ago of raping and killing a woman in the city of Shijiazhuang in China’s northern province of Hebei.

He was executed on April 27, 1995, after a provincial court upheld the decision, in an appeal against his conviction by a city court.

The exoneration by the Supreme People’s Court followed a second re-examination of the case, that began in June.

“The facts are unclear, the evidence is insufficient”, the official Xinhua news agency said.

Much of the evidence used against Nie was suspect, the court ruled, adding that there were doubts about the legitimacy of his confession.

A Supreme People’s Court official said in an interview with Xinhua there were “profound lessons” to be learnt from the case, which it called “typical” of poorly evidenced convictions.

Videos of Nie’s family bursting into tears at the news of Friday’s verdict were shared thousands of times on the microblog Weibo, China’s equivalent of social network Twitter.

The Hebei provincial court offered its “sincere apologies” to Nie’s family, and said it would immediately begin a compensation application process, as well as launching an investigation into its role in the case.

The original decision had been thrown into doubt in 2005, when another man, Wang Shujin, confessed to the murder and rape, provoking wide discussion of Nie’s case and an outpouring of support for his bereft parents.

Following an appeal by the parents in 2007, legal authorities decided there was enough doubt to justify a re-examination by the Supreme People’s Procurate.

Wrongful executions have often stirred public outrage in China, particularly over confessions extracted under torture, but capital punishment itself has wide support.

In 2014, a court posthumously acquitted an ethnic Mongol, Huugjilt, who had been executed for raping and killing a woman in a public restroom, a miscarriage of justice that sparked widespread anger.

Huugjilt, like many ethnic Mongols, went by a single name.

Another man was later sentenced to death for the crime.

China guards as a state secret the number of people it executes annually, but campaigners against the death penalty say it is used more extensively than elsewhere.