A Canadian man has told reporters he stabbed and killed a British friend in self-defence at a spiritual retreat in the Peruvian jungle because he felt he had no choice but to kill or be killed.

Joshua Stevens told Canadian broadcaster CTV Winnipeg that Unais Gomes, 26, a University of Cambridge graduate from London, attacked him and two others in December after taking the hallucinogen ayahuasca.

Stevens, 29, was arrested by Peruvian authorities and held on suspicion of murder but was subsequently released and allowed to return to Canada after witness reports corroborated his version of events. However, Stevens told reporters the investigation remains open, and if charges are pursued he will have to return to Peru.

The two men were guests at the Australian-owned Phoenix Ayahuasca retreat near the jungle city of Iquitos, which specialises in ayahuasca, a plant brew that has been hailed for centuries by indigenous tribes in South America as a cure for a range of ailments.

The hallucinogenic substance, which is illegal in the UK, is sought out by tourists, sometimes for its healing properties – it is used to treat post-traumatic stress disorder (PTSD), depression, and addictions – but also for the mind-altering experience it offers.

Stevens said he had travelled to the retreat in the hope of curing a skin condition, which also caused his hair to fall out, that he had suffered from for years.

He said he was meditating away from the rest of the group, when he heard Gomes, who had taken a double dose of ayahuasca, screaming. The man he described as a “life-long friend” attacked him and two workers at the retreat with a large butcher’s knife.

Before he attacked, Stevens said Gomes apparently told him: “It’s time to get your demons out, brother.”

Stevens said he tried to run away but was cornered in a kitchen, where he grabbed a steel pot after Gomes picked up a knife.

“He swiped at me and he hit the table and his knife broke. I went to hit him with the pot and I hit him in the side of the body and my pot broke. When that happened, that’s when he picked up this big butcher knife,” Stevens said.

As they fought over the knife, two employees of the retreat came in and tried to grab Gomes, who then attacked them.

“That’s when I made the decision to stab him,” said Stevens, who said the incident has left him with a deep feeling of sadness. “I really thought I was going to die. I was saying to myself, ‘If he gets this knife back, he’s either going to kill me or the other two men here.’”

Stevens stabbed Gomes once in the chest and once in the stomach. He was held for 24 hours before being released without charge.

Gomes had previously worked at Citibank in London but left the financial industry a year ago to found Clean Tech, a company focused on water sustainability, in San Francisco.

His family, who are originally from Kyrgyzstan, live in St John’s Wood, north London. Gomes’s girlfriend told the Evening Standard he sent her text messages before his death in which he said he had left the retreat, one saying: “Bad experience”. He also described it as “crazy” and said he did not like it there. But in the final text she received, he wrote that he was going back. “Now they have called an amazing shaman to clean up that place,” he said.

Phoenix Ayahuasca is run by Australian siblings Tracie and Mark Thornberry. In a statement on the retreat’s website, she said: “We are deeply shocked and saddened by what happened at our centre. Our thoughts and prayers are with the two boys, Unais and Joshua, and with their families … I have accounts of the events by the people present and cannot see how it could have been prevented had either Mark or I been there.”