After a two-year chase, a NASA spacecraft arrived Monday at the ancient asteroid Bennu, its first visitor in billions of years.

The robotic explorer, OSIRIS-REx pulled within 12 miles of the diamond-shaped space rock. It will get even closer in the days ahead and go into orbit around Bennu on December 31. No spacecraft has ever orbited such a small cosmic body.

It is the first American attempt to gather asteroid samples for return to Earth, something only Japan has accomplished so far.

Flight controllers clapped and exchanged high-fives once confirmation came through that OSIRIS-REx made it to Bennu — exactly one week after NASA landed a spacecraft on Mars.

“Relieved, proud, and anxious to start exploring!” tweeted lead scientist Dante Lauretta of the University of Arizona. “To Bennu and back!”

Scientists are eager to study material from carbon-rich asteroids such as Bennu, which could hold evidence dating back to the beginning of our solar system 4.5 billion years ago.

With Bennu some 76 million miles away, it took seven minutes for word to get from the spacecraft to flight controllers at Lockheed Martin in Littleton, Colorado. The company built the spacecraft there.

About the size of an SUV, the spacecraft will shadow the asteroid for a year, before scooping up some gravel for return to Earth in 2023.

A Japanese spacecraft, meanwhile, has been hanging out at another near-Earth asteroid since June, also for samples. It is Japan’s second asteroid mission. This latest rock is named Ryugu and about double the size of Bennu.

Ryugu’s samples should be here by December 2020. OSIRIS-REx aims to collect at least two ounces of dust and gravel. The spacecraft won’t land, but rather use a 10-foot mechanical arm in 2020 to touch down and vacuum up particles. The sample container would break loose and head toward Earth in 2021.

The collection — parachuting down to Utah — would represent the biggest cosmic haul since the Apollo astronauts hand-delivered moon rocks to Earth in the late 1960s and early 1970s.

NASA has brought back comet dust and solar wind particles before, but never asteroid samples.

Both Bennu and Ryugu are considered potentially hazardous asteroids. That means they could smack Earth years from now. At worst, Bennu would carve out a crater during a projected close call 150 years from now.