The major breakthrough was revealed in the first international clinical trial of the birth control.
Professor David Baird, of the university's obstetrics and gynaecology department, led studies into the development of the contraceptive.
Men from Edinburgh, Shanghai, Cape Town and a village outside Lagos in Nigeria volunteered to take part in the trial.
Switching off sperm
About 30 men at each of the centres took the pill over a period of months with none producing sperm and none experiencing side effects such as acne and high blood pressure.
The most effect form of contraception is the female pill.
It was much easier for scientists to develop as women normally only produce one egg per cycle.
However, men are known to produce millions of sperm.
The new technology has enabled experts to develop a hormone which switches off the production of sperm.
Men in favour
Anne Wayman, chief executive of the family planning association says more choice in methods of contraception is welcome, but this may not suit everyone.
The full results of the trial are expected to be released to the World Conference for Gynaecologists and Obstetricians in Washington in September.
Further trials are taking place and pharmaceutical company Organon is developing the actual pill which it hopes could be available within five years.
A recent study showed that three-quarters of Scottish, Chinese and white South African women thought that men would be prepared to use the method and even in the more conservative black and mixed race South African population, 40% agreed their partners would probably use it.
Only 2% said they would not trust their partners to take it.
The findings were published in Human Reproduction, the journal of the European Society of Human Reproduction and Embryology.