At the start of the experiment, the scientists only added adult worms.
"However, the best surprise came at the end of the experiment when we found two young worms in the Mars soil simulant," said Wieger Wamelink of Wageningen University & Research.
The researchers used pig slurry to fertilise the soil.
"The positive effect of adding manure was not unexpected, but we were surprised that it makes Mars soil simulant outperform Earth silver sand," Wamelink said in a statement released by the university.
Worms are very important for a healthy soil, not only on Earth but also in future indoor gardens on Mars or the Moon. They thrive on dead organic matter such as old plant remains, which they eat, chew and mix with soil before they excrete it.
By digging burrows the worms also aerate and improve the structure of the soil, making watering the plants more effective.
The researchers said they were able to grow over a dozen crops in the Mars soil simulant. The crops also passed a safety test for human consumption.
"The only species that has resisted our efforts so far is spinach," the researchers said.