Horny goat weed and related herbs have purportedly been treatments for sexual dysfunction for years.

Now scientists may be a step closer to discovering how compounds from horny goat weed may work.

The ability to get and maintain an erection depends upon blood flowing into the penis and staying there long enough. One way drugs like Viagra work is to inhibit an enzyme called PDE-5, thereby keeping blood flowing to the penis.

Researchers, led by Mario Dell'Agli at the University of Milan, found that the main compound in horny goat weed, called icariin, acted the same way that Viagra does.

The research team studied a handful of plants and the compounds in them. They found that out of all the plant compounds, icariin was the most potent of the group.

Scientists tested icariin and other plant compounds in a lab by exposing them to an enzyme that regulates blood flow to the penis. They also chemically modified the icariin and found that its effect in the lab was similar to that of Viagra.

They write that this "is a promising candidate for further development."

They warn, however, that some plant extracts could actually "interfere with erectile function."

ED is a condition that affects some 18 million men in the U.S.

The study is to be published in the Oct. 24 issue of the Journal of Natural Products.