Astronauts are to test the world's first asteroid mining devices, in an advance that could open up a new frontier in space exploration.

Prototype kits are being sent from Edinburgh to the International Space Station to study how microscopic organisms could be used to recover minerals and metals from space rocks.

The groundbreaking study could aid efforts to establish manned settlements on distant worlds by helping develop ways to source minerals essential for survival in space.

Tests will reveal how low gravity affects bacteria's natural ability to extract useful materials - such as iron, calcium and magnesium - from rocks, researchers say.

Their findings could also help improve the process - known as biomining - which has numerous applications on Earth, including in the recovery of metals from ores.

Astrobiologists from the UK Centre for Astrobiology at Edinburgh University developed the matchbox-sized prototypes - called biomining reactors - over a ten-year period.

Eighteen of the devices will be transported to the International Space Station aboard a SpaceX rocket, which is scheduled to launch on July 21 from Cape Canaveral in Florida, US.

Upon arrival at the space station, small pieces of basalt rock - which makes up the surface of most asteroids - will be loaded into each device and submerged in bacterial solution.

Tests will be conducted in low gravity to find out how conditions on asteroids and planets such as Mars might affect the ability of bacteria to mine minerals from rocks found there.

The experiment will also study how microbes grow and form layers - known as biofilms - on natural surfaces in space. As well as providing insights into how low gravity affects biofilms, the findings will also improve understanding of how microbes grow on Earth.

The rocks will be sent back to Earth after the three-week experiment, to be analysed by the Edinburgh team in a lab at Stanford University.

The project is led by Edinburgh University, with the European Space Agency and the UK Space Agency. The work is funded by the Science and Technology Facilities Council.

Professor Charles Cockell, of the university's School of Physics and Astronomy, said: "This experiment will give us new fundamental insights into the behaviour of microbes in space, their applications in space exploration and how they might be used more effectively on Earth in all the myriad way that microbes affect our lives."

Dr Rosa Santomartino, who will lead the study of the rocks when they return, added: "Microbes are everywhere, and this experiment is giving us new ideas about how they grow on surfaces and how we might use them to explore space."