Kneeling on the edge of a deep crater, astronaut Alexander Gerst uses a chisel to collect a sample of volcanic rock which he carefully puts inside a white plastic bag.
Gerst is not on the Moon, even if it looks like it. He is in the middle of Los Volcanes Natural Park on the island of Lanzarote in Spain's Canary Islands, off the northwest coast of Africa.
With its blackened lava fields, craters and volcanic tubes, Lanzarote's geology can be uncannily similar to that of the Moon and Mars -- so much so that the European Space Agency (ESA) and NASA have for years been sending astronauts to the island to train.
"This place has lavas that are very, very similar to the ones that we find on the Moon," Gerst, a 46-year-old German astronaut with the ESA, told AFP.
He said the island was "a unique training ground".
Gerst, who has completed two missions on the International Space Station, is one of about a dozen astronauts who have taken part in the ESA's Pangaea training course in Lanzarote over the past decade.
Named after the ancient supercontinent, Pangaea seeks to give astronauts as well as space engineers and geologists the skills needed for expeditions to other planets.
Trainees learn how to identify rock samples and collect them, do on-the-spot DNA analysis of microorganisms, and communicate their findings back to mission control.
"Here, they are put into the field to experience the exploration of a terrain, which is something they will have to do on the Moon," said Francesco Sauro, the technical director of the course.
Gerst said the Pangaea training course, which he has just completed, helps prepare astronauts to work in a remote setting on their own.
"If we run into a problem, we have to solve it ourselves," he said.
He completed the Pangaea training along with Stephanie Wilson, one of NASA's most senior astronauts. Both are possible candidates for NASA's next crewed Moon missions.
Named for the goddess who was Apollo's twin sister in ancient Greek mythology, NASA's Artemis programme aims to return astronauts to the Moon's surface as early as 2025, though many experts believe that time frame might slip.
Twelve astronauts walked on the Moon during six Apollo missions from 1969 to 1972, the only spaceflights yet to place humans on the lunar surface.
NASA and the ESA also regularly use Lanzarote's landscape of twisted mounds of solidified lava to test Mars Rovers -- remote controlled vehicles designed to travel on the surface of the Red Planet.
Lanzarote's unique geography stems from a volcanic eruption that began in 1730 and lasted six years, spewing ash and lava over large swathes of land.
Considered one of the greatest volcanic cataclysms in recorded history, the eruption devastated over 200 square kilometres (77 square miles) of terrain - - about a quarter of the island which is currently home to around 156,000 people.
While there are other volcanic areas such as Hawaii that could also be used for astronaut training, Lanzarote has the advantage that it has little vegetation due to its desert-like climate.
"You have a lot of different types of volcanic rocks in Lanzarote. And they are exposed. You don't have trees," said Pangaea project leader Loredana Bessone.
"You can see far away, as if you were on the Moon," she told AFP.
The Canary Islands is making a big contribution to space exploration in another way too. The island of La Palma is home to one of the world's largest optical telescopes.
Located on a peak, the Great Canary Telescope is able to spot some of the faintest, most distant objects in the Universe.
La Palma was selected as the site for the telescope because of its cloud-free skies and relatively low light pollution.