A man who confessed to killing a gay couple has been acquitted of murder by a jury in Spain, who accepted his defence of “fear”.

Jacobo Piñeiro Rial will instead spend 20 years in prison for setting fire to the home of Isaac Ali Dani Peréz Triviño and Julio Anderson Luciano in July 2006.

The couple, who lived together in Vigo, were planning to marry.

Piñeiro told the court in Pontevedra that he had met one of the men in a bar and returned to their house to have a meal with them.

Later that night, he stabbed the couple 57 times and then set fire to the house, claiming that that he had suffered “an unbearable fear” in their presence after one of the men had allegedly threatened him with sex at knifepoint.

Despite the number of wounds inflicted, a jury found him “in legitimate defence”.

It was revealed in court that Piñeiro had spent the previous day drinking and taking cocaine at a local gay bar.

His defence attempted to argue that this had clouded his judgement, but toxicology experts said the substances would have left his body by the time of the murders.

Issac’s mother, who lived with the couple but was away the night they were killed, described the verdict as “homophobic, racist and brainless”.

Protests against the acquittal are being held in Madrid, Barcelona, Vigo and New York on Saturday, while a Facebook group has been set up to publicise the events.

The best-known case of the gay panic defence was in the murder of US student Matthew Shepard.

He was killed in October 1998 on the outskirts of Laramie, Wyoming, by two men he had met in a bar.

Local residents Aaron McKinney and Russell Henderson, both 21 at the time, were charged with Matthew’s murder.

They told the prosecution they suffered “a moment of insanity” when he allegedly made sexual advances to him.

He was robbed, beaten and left to die tied to a fence.

Both men are serving consecutive double life sentences.