Crops have been produced in the same conditions as Mars and the Moon – including trendy salad leaf rocket.
Scientists say this is the next step in making human beings comfortable when they settle on plants and celestial bodies beyond Earth.
Researchers at Wageningen University and Research in the Netherlands produced crops in soil simulants developed by NASA.
Scientists were able to grow rocket, garden cress, tomato, radish, rye, quinoa, chives, peas and leek.
Spinach, which was also planted, failed to grow in the Lunar and Martian soil.
Study lead author Wieger Wamelink said: “We were thrilled when we saw the first tomatoes ever grown on Mars soil simulant turning red.
“It meant that the next step towards a sustainable closed agricultural ecosystem had been taken.”
The Dutch researchers said growing fresh vegetables and herbs could benefit those living on the International Space Station.
Senior ecologist Dr Wamelink said: “There are several reasons to grow fresh food on Mars or the Moon: it is healthy, it contains more flavours and is thus more tasteful than spacefood, and it saves costly cargo volume in a spacecraft.
“Astronauts on the ISS often complain about the taste of their food and spicy crops may therefore be a welcome addition to their diet.”
Researchers used Earth soil as a control, and found Martian soil the easiest to cultivate the crops in.
During the last Friday of each month during the test, the researchers added a solution that mimicked the addition of human faeces and urine.
Dr Wamelink said: “This is a small step towards the final goal, a sustainable agricultural ecosystem for a Moon and Mars colony.”
The article was published in the journal Open Agriculture.