CAPE CANAVERAL, Fla. - The first NASA explorer of its kind took off on a seven-year quest Thursday, chasing after a big, black, unexplored asteroid to gather a few handfuls of gravel for return to Earth.

These bite-size bits of ancient space rock from asteroid Bennu could hold clues to the origin of life, not just on our planet but potentially elsewhere in the solar system.

Thousands gathered to witness the evening launch of Osiris-Rex, a robotic hunter that looks something like a bird with its solar wings. The spacecraft took flight atop an Atlas V rocket, which soared a little before sunset on the mission, a U.S. first.

Victory was declared an hour later; launch controllers shook hands and embraced as the spacecraft shot out of Earth's orbit, bound for Bennu.

"Tonight is a night for celebration. We are on our way to an asteroid," said NASA's chief scientist, Ellen Stofan. After all, "we've just done something amazing."

"We got everything just exactly perfect," added Osiris-Rex chief scientist Dante Lauretta of the University of Arizona. "It was an amazing evening for me and for this team."

It will take two years for Osiris-Rex to reach Bennu, which is circling the sun in a slightly wider orbit than Earth's. The boxy spacecraft will actually go into orbit around the asteroid, seeking out the best spot before going in for a quick bite.

Round trip, the SUV-sized spacecraft will travel more than 6 1/2 billion kilometres by mission's end in 2023.

NASA has gone after comet dust and solar wind particles before, but never anything from an asteroid. It promises to be the biggest cosmic haul since the Apollo moon rocks.

The roundish rock - an estimated 500 metres across and taller than the Empire State Building - is believed to harbour carbon dating back 4.5 billion years, to the beginning of our solar system. That makes it a time capsule and a scientific prize.

"We will make discoveries on this mission that we have not anticipated. It's exciting!" said Bill Nye, "The Science Guy," chief executive officer of the Planetary Society.

The launch came 50 years to the day that the first "Star Trek" episode aired on TV. NASA launch commentator Mike Curie referenced the anniversary, urging the spacecraft at liftoff "to boldly go" to Bennu and back. This is yet another example of NASA "turning science fiction into science fact," Stofan noted.

Osiris-Rex may lead to asteroid-mining missions, according to scientists, and could help protect the planet from menacing space rocks.

Japan already has visited an asteroid and returned some specks (the mission didn't go quite as planned), and is chasing another space rock for even more samples. Osiris-Rex's bounty, however, should surpass that; Lauretta and his team want at least 60 grams of dust and gravel, or 2 ounces' worth when the big day comes in 2020. Ground tests have yielded eight times that in a single scoop, so hopes are high for four to five handfuls.

Osiris-Rex will hover like a hummingbird over Bennu, according to Lauretta, as the spacecraft's 3-metre mechanical arm touches down like a pogo stick on the surface for three to five seconds. Thrusters will shoot out nitrogen gas to stir up the surface, and the loose particles will be sucked up into the device. Spacecraft managers call it "the gentle high five." They get just three shots at this, before the nitrogen gas runs out and the effort abandoned.

The team opted for this touch-and-go procedure instead of landing to increase the odds of success. Despite extensive observations of Bennu from ground and space telescopes, no one knows exactly what to expect there, and it could be difficult if not impossible to anchor a spacecraft on the surface, Lauretta said.

Osiris-Rex's freed sample container - the same kind used for the comet-dust retrieval - will parachute down with the pristine asteroid treasure in Utah. The mother spacecraft, meanwhile, will continue its orbit of the sun.

Among the 8,000 NASA launch guests was the schoolboy who came up with the asteroid's name for a contest.

Twelve-year-old Mike Puzio of Greensboro, North Carolina, cheered as he watched his first up-close rocket launch: "It was awesome!"

"Unbelievable," added Dr. Larry Puzio, his pediatrician dad.

The name Bennu comes from the heron of Egyptian mythology. Mike thought Osiris-Rex looked like a bird, with its twin solar wings and long arm outstretched for a sample grab. And with the spacecraft named after the Egyptian god Osiris, Bennu was an obvious choice, he said.

Osiris-Rex is also a NASA acronym for origins, spectral interpretation, resource identification, security-regolith explorer. The estimated cost of the mission is more than $800 million.

"Space exploration brings out the best in us," Nye said shortly before Osiris-Rex began its journey. "It is an extraordinary use of our intellect and treasure to elevate humankind, to help us know our place in the cosmos."

It may also one day save the home planet.

Bennu swings by Earth every six years, and 150 years from now, could hit us. The odds are less than one-tenth of 1 per cent, according to Lauretta. While this particular rock won't destroy Earth - just carve out a huge crater - other asteroids could cause more trouble.

Osiris-Rex will help scientists better understand the ever-changing paths of asteroids, and that could prove its biggest payoff.

-----

AP writer Alex Sanz contributed to this report.