The venom of the Brazilian wandering spider (Phoneutria nigriventer) can cause necrosis of the penis – essentially, the death of penis tissue – which can sometimes require amputation.

It's a terrifying poison best avoided, yet research suggests that in smaller amounts, the venom could hold clues to the next Viagra.

The large dose of venom dished out by the spider in nature triggers erections in mammals that are very painful and that last much too long for their primary purpose. These abnormally extended boners are technically known as priapisms, and the venom adds nausea and abdominal cramps for good measure.

P. nigriventer is also known as the banana spider because it is commonly found on banana leaves. The arachnid's body can grow up to five centimeters in length, and its leg span sometimes stretches three times further than that. It's one of the most toxic spiders there is.

Nevetherless, scientists from the Universidade Federal de Minas Gerais in Brazil have been able to develop a synthetic version of the molecule in the venom that causes the erection. It's called BZ371A, and has now been tested with some success on mice and rats: when put into a gel and spread on the groins of the animals, erections were triggered.

These effects happen because P. nigriventer venom (and BZ371A) triggers the release of nitric oxide in the body, which in turn boosts blood flow to the genitals. Viagra works in a similar way, by making the penis more sensitive to nitric oxide as it's released.

Even better, the treatment worked in older rats and those with conditions like high blood pressure and diabetes, suggesting that this approach might work for humans who can't take Viagra for those same reasons.

Viagra and another anti-impotence drug called Cialis have proved very effective for many, but they don't work for around 30 percent of men – and there's a risk of drops in blood pressure if they are taken alongside nitrates, which are often prescribed to treat chest pain and which some people use recreationally during sex. There's also a chance of complications for those with serious heart or liver problems.

A pilot test on men and women has already been carried out, showing that the gel is safe for people to use – although more thorough and comprehensive tests will be required to determine if this is a genuine Viagra alternative.

Further clinical trials are planned, in which the treatment is going to be tested in men with erectile dysfunction. Further down the line, the researchers hope it could work for sexual dysfunction in women as well.

The team behind the research is keen to point out the value of maintaining biodiversity in the animal kingdom, as this means scientists have a host of natural chemicals and remedies to discover – even in potentially toxic venom.