TOKYO — Japan’s space agency said an explosive dropped Friday from its Hayabusa 2 spacecraft successfully blasted the surface of an asteroid for the first time to form a crater and pave the way for the collection of underground samples for possible clues to the origin of the solar system.

Friday’s mission was the riskiest for Hayabusa 2 because it had to immediately move away so it wouldn’t get hit by flying shards from the blast.

The Japan Aerospace Exploration Agency, or JAXA, said Hayabusa 2 dropped a small explosive box which sent a copper ball the size of a baseball slamming into the asteroid, and that data confirmed the spacecraft had safely evacuated and remained intact. JAXA later confirmed the impact from images transmitted from a camera left behind by the spacecraft which showed the impactor being released and fine particles later spraying dozens of meters (yards) out from a spot on the asteroid.

An explosive dropped from the Hayabusa2 spacecraft to make a crater on the asteroid Ryugu on April 5, 2019. JAXA via AP

“The mission was a success,” JAXA project manager Yuichi Tsuda said, beaming. “It is highly likely to have made a crater.”

JAXA plans to send Hayabusa 2, which was moved to the other side of the asteroid, back to the site after dust and debris settle for observations and to collect samples of material from the new crater that was unexposed to the sun or space rays. Scientists hope the samples will help them understand the history of the solar system, since asteroids are left over material from its formation.

No such samples have been recovered. In a 2005 “deep impact” mission to a comet, NASA observed fragments after blasting the surface but did not collect them.

Last month, JAXA announced that a group of scientists participating in the Hayabusa 2 mission had detected hydroxyl-bearing minerals on the asteroid by analyzing near-infrared spectrometer readings by the spacecraft. It said that could help explain where the Earth’s water came from. The results were published in the online edition of Science magazine.

“So far, Hayabusa 2 has done everything as planned, and we are delighted,” mission leader Makoto Yoshikawa said earlier Friday. “But we still have more missions to achieve and it’s too early for us to celebrate.”

Hayabusa 2 successfully touched down on a small level area on the boulder-strewn asteroid in February, when it also collected some surface dust and small debris. The craft is scheduled to leave the asteroid at the end of 2019 and bring the surface fragments and underground samples back to Earth in late 2020.

The asteroid, named Ryugu after an undersea palace in a Japanese folktale, is about 300 million kilometers (180 million miles) from Earth.

Want more stories about space?

SIGN UP FOR THE MACH NEWSLETTER AND FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.