Researchers hope to be able to target the same protein in men, however, more tests will be needed to show whether the drug is both safe and effective in people.
Scientists believe they are a step closer in the difficult journey towards developing a male contraceptive pill, after successful studies in mice.
A contraceptive pill for women has been around for decades, but an equivalent for men has proved elusive.
A US study, published in the journal Cell, showed a drug could make mice temporarily infertile without hampering their sex drive.
Experts said the findings were "exciting", but needed tests in people.
It has been argued that the lack of a male contraceptive pill has contributed to the number of unplanned pregnancies.
One of the challenges is developing a drug which can cross over from the blood into the testes.
US researchers at the Dana-Farber Cancer Institute and Baylor College of Medicine were testing a drug called JQ1. It targets a protein which exists only in the testes and is critical for sperm production.
The testes of mice taking the drug began to shrink as they produced fewer sperm, which were also less mobile. Some were rendered infertile.
When the animals were no longer taking the drug they were able to have babies.
One of the researchers, Dr James Bradner said: "This compound produces a rapid and reversible decrease in sperm count and motility with profound effects on fertility.
"These findings suggest that a reversible, oral male contraceptive may be possible."