Tokyo (CNN) A Japanese spacecraft has reached a diamond-shaped asteroid three years after setting off on its mission to learn about the origins of Earth.

The Hayabusa2 spacecraft arrived Wednesday at the asteroid Ryugu after leaving on a 300 million-kilometer (186.4 million-mile) journey from Earth that began in December 2014, the Japan Aerospace Exploration Agency said.

The spacecraft is roughly 20 kilometers (12.4 miles) from the asteroid, from where it will launch a projectile into the rock in a bid to excavate samples from beneath the surface.

The Japanese spacecraft Hayabusa2 is expected to return to Earth by late 2020.

Later, Hayabusa2 will touch down on the asteroid and collect the samples. It will depart Ryugu in December 2019 and finally return to Earth by the end of 2020.

Beneath their desolate surface, asteroids are believed to contain a rich treasure-trove of information about the formation of the solar system billions of years ago.

Read More