Millions of sexually active women who rely on the contraceptive pill may be putting themselves at risk of long-term sexual dysfunction.

Scientists believe they have uncovered the mechanism that leads to mood swings, health problems and sexual difficulties among some users of the pill which persist even when they stop taking it. They say GPs should be aware of the pill's physiological effects before assuming women's sexual problems are psychological.

But family planning experts said it was almost impossible to show a true association between the pill and loss of sexual desire, or sexual problems, because there were many other confounding factors. The latest American study of 124 women with sexual problems lasting more than six months showed they had reduced levels of "unbound" testosterone.

Testosterone is the male sex hormone, but it is also present in females at lower levels and plays a key role in sexual, metabolic and mental health.

The researchers found high levels of a protein that binds testosterone, rendering it unavailable to the body, in users of the pill. The high level of the protein persisted in women who had stopped taking it.

Long-term exposure to the oestrogens in the pill may lead to gene imprinting which results in over-production of the protein called sex hormone binding globulin (SHBG), the researchers say. This may lead to long-term problems with low levels of "unbound" testosterone. The pill is the most common contraceptive in the UK with 3.5 million users. Worldwide that figure is 100 million.

Andrรฉ Guay, co-author of the study published in the Journal of Sexual Medicine and director of the Centre for Sexual Function in Peabody, Massachusetts, said: "This study is a revelation. For years we have known that a subset of women using oral contraceptives suffer from decreased sex drive. We know that the pill suppresses ovulation and the male hormone [through production of SHBG]. Therefore these pills decrease a woman's male hormone availability by two separate mechanisms. No wonder so many women have had symptoms."

Claudia Panzer, an endocrinologist in Denver and co-author of the study, said: "Physicians prescribing oral contraceptives should point out to their patients potential side effects."

She added: "If women present with these complaints, it is crucial to recognise the link between sexual dysfunction and the oral contraceptive."

Several studies in the past 30 years have suggested the pill may cause problems. But Toni Belfield, director of information for the UK Family Planning Association, said: "Sexual relationships are very complex. How we feel and what we do all relate to what we feel sexually. The pill does have side effects in some women and may affect their mood.

"But women on the pill may be going through other things - the break-up of a relationship, leaving home for the first time - that affect them. Most studies have been unable to draw a true association with sexual problems."