Scientists have made primitive forms of artificial sperm and eggs in a medical feat that could transform the understanding of age-related diseases and fertility problems.

Researchers in Cambridge made the early-stage sex cells by culturing human embryonic stem cells under carefully-controlled conditions for a week.

They followed the success by showing that the same procedure can convert adult skin tissue into precursors for sperm and eggs, raising the prospect of making sex cells that are genetically matched to patients.

The cells should have the potential to grow into mature sperm and eggs, though this has never been done in the lab before. The next step for the researchers will be to inject the cells into mouse ovaries or testes to see if they fully develop in the animals.

British law prohibits fertility clinics in the UK from using artificial sperm and eggs to treat infertile couples. But if the law was revised, skin cells could potentially be taken from patients and turned into genetically identical sperm or eggs for use in IVF therapies.

Skin cells from a woman could only be used to make eggs because they lack the Y chromosome. Those from a male might theoretically be turned into eggs as well as sperm, but Azim Surani, who led the work at the Gurdon Institute in Cambridge, said that on the basis of current knowledge, that was unlikely.

“It’s not impossible that we could take these cells on towards making gametes, but whether we could ever use them is another question for another time,” Surani told the Guardian.

Researchers have made sperm and eggs from rodent stem cells before but have struggled do the same with human cells. In 2012, Japanese scientists created mouse eggs from stem cells and used them to make baby mice. Three years earlier, scientists at Newcastle University claimed to have made human sperm from stem cells, but their scientific paper was retracted amid allegations of plagiarism. In 2002, US researchers produced male and female mouse pups from male stem cells.

Surani’s team tried a number of different approaches before hitting on a culture process that turned up to half of the human stem cells in the dish into precursors of sperm and eggs. Over the five day process, the scientists added natural chemicals called growth factors to nudge the cells in the right developmental direction.

“It’s remarkably fast. We can now take any embryonic stem cell line and once we have them in the proper conditions, we can make these primordial cells in five to six days,” Surani said. Details of the work, a collaboration with the Weizmann Institute in Israel, are published in the journal, Cell.

Through studying the cells, scientists hope to unravel how sperm and eggs arise and mature into adult sex cells. The ability to make immature sperm and eggs from patients’ skin means scientists will be able to compare how they develop differently when they are made from healthy versus infertile people. “This is really the foundation for future work,” Surani said.

Perhaps more intriguingly, the cells may hold the secrets for treating certain age-related diseases. As people age they accumulate not only genetic mutations, but other changes to their DNA. These epigenetic changes can be caused by smoking, exposure to chemicals in the environment, or diet and other lifestyle factors. But the cells that form sperm and eggs are wiped clean of their epigenetic changes early on. “This could tell us how to erase these epigenetic mutations. Epigenetics is used to regulate gene expression, but in age-related diseases, these changes can be aberrant and misregulate genes,” Surani said.

Allan Pacey, senior lecturer in andrology at the University of Sheffield, said that Surani’s cells could have other uses too. When men are given chemotherapy it makes them infertile. Dishes of human sperm cells could be used to understand why, and to screen new anti-cancer drugs that are not so damaging to sperm.

In the course of their work, Surani’s team discovered that a specific gene, named SOX17, was crucial for turning human stem cells into early-stage sperm and eggs. The finding was a surprise, because in mice the equivalent gene does not play any role. The implications are wide-ranging. “Mice are the key model we use to study mammalian development and we extrapolate from mice to humans,” said Surani. “This work tells us that the extrapolation can be unreliable. I’m not saying that all work in mice doesn’t apply in humans, but there are fundamental differences we need to be wary of,” he said.