NASA's first asteroid-sampling spacecraft, equipped with sophisticated Canadian mapping technology, took off Thursday night to cheering crowds gathered to witness the start of its seven-year quest.

A United Launch Alliance Atlas 5 rocket lifted off at 7:05 p.m. ET from Cape Canaveral, Fla. Perched on top of the 19-story rocket was NASA's robot explorer OSIRIS-REx, built by Lockheed Martin to carry out the seven-year, $1- billion mission to and from the near-Earth asteroid Bennu.

We have liftoff! <a href="https://twitter.com/OSIRISREx">@OSIRISREx</a> streaks across the crystal clear blue sky on the <a href="https://twitter.com/ulalaunch">@ulalaunch</a> Atlas V! <a href="https://twitter.com/hashtag/ToBennuAndBack?src=hash">#ToBennuAndBack</a> <a href="https://t.co/EwEfIBOT4j">pic.twitter.com/EwEfIBOT4j</a> —@NASA_Marshall

The 1,500-kilogram solar-powered probe is expected to take two years to reach its destination, a dark, rocky mass roughly a third of a mile wide and shaped like giant acorn orbiting the sun at roughly the same distance as Earth.

The craft's mission is to gather dust and rocks from the surface of the asteroid, and then bring the material back to Earth for scientists to analyze.

Scientists believe Bennu is covered with organic compounds dating back to the earliest days of the solar system.

"You can think of these asteroids as literally prebiotic chemical factories that were producing building blocks of life 4.5 billion years ago, before Earth formed, before life started here," NASA astrobiologist Daniel Glavin said before launch.

Canada's role

The craft will also collect unprecedented 3D maps of Bennu using the OSIRIS-REx laser altimeter (OLA), a sophisticated mapping technology developed by Canadian researchers and supplied by the Canadian Space Agency.

"​OLA will scan and measure the entire surface of the asteroid to create a highly accurate 3D model of the asteroid, and provide mission scientists with unprecedented information on the asteroid's shape, topography, distribution of boulders, rocks and other surface features," according to the space agency.

The OSIRIS-REx laser altimeter uses sophisticated mapping technology developed by Canadian researchers and supplied by the Canadian Space Agency. (Debora McCallum/NASA/Goddard Space Flight Center via Canadian Space Agency )

In exchange for providing the mapping device, the Canadian Space Agency will get a portion of the samples gathered during the mission, to be studied by researchers from the universities of Toronto, Calgary and Winnipeg and the Royal Ontario Museum.

"Having access to part of the sample will enable the Canadian science team to conduct research that could revolutionize our understanding of the solar system's history, how our planet formed, and possibly the origin of water and life on Earth," the agency said in a statement.

A CDN laser will make a 3D map of <a href="https://twitter.com/hashtag/Bennu?src=hash">#Bennu</a> and sleuth out the best sample site for the <a href="https://twitter.com/OSIRISREx">@OSIRISREx</a> mission. <a href="https://t.co/NpBnlZgava">pic.twitter.com/NpBnlZgava</a> —@csa_asc

It's a rare treat for Canada.

"For decades, scientists in Canada have been studying through telescopes or by recovering fragments of asteroids that have landed on Canadian soil through meteorite impacts," the agency said.

"However, when meteors enter our atmosphere, they are subjected to extreme temperatures, baking away some of the key clues scientists are searching for."

This artist's rendering made available by NASA in July 2016 shows the mapping of the near-Earth asteroid Bennu by the OSIRIS-REx spacecraft. (NASA/Goddard/University of Arizona via Associated Press)

Bennu, which is about 500 metres in diameter, is 4.5 billion years old — it dates back to the beginning of our solar system. Scientists say the dark rock, which appears to be full of carbon, could unlock the secrets of the origins of life on Earth.

Boy, 12, named the asteroid

In addition to the crowds of spectators, more than 8,000 NASA guests descended on Cape Canaveral for the liftoff, including the 12-year-old schoolboy who named the asteroid. Mike Puzio of Greensboro, N.C., won a naming contest in 2013.

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

The OSIRIS-REx spacecraft that will travel to the asteroid Bennu and bring a sample back to Earth for study is depicted in a NASA artist rendering. (NASA)

OSIRIS-REx is the latest in a series of missions to asteroids that began with the 1991 flyby of asteroid Gaspra by NASA's Jupiter-bound Galileo spacecraft.

Only one other spacecraft, Japan's Hayabusa, has previously returned samples from an asteroid to Earth, but due to a series of problems it collected less than a milligram of material. A follow-on mission, Hayabusa 2, is underway, with a return to Earth planned for December 2020.

United Launch Alliance is a private partnership between Lockheed and Boeing.