A NASA spacecraft, which scientists believe has collected samples from an asteroid, has begun its two-year journey back to Earth.

NASA's OSIRIS-REx spacecraft is attempting to complete a mission to visit Bennu, a skyscraper-sized asteroid some 320 million kilometres from Earth, and survey its surface, collect samples, and deliver them back to Earth.

Staff celebrated at the OSIRIS-REx control room in Colorado as the space vehicle pushed away from the asteroid, whose acorn-shaped body formed in the early days of our solar system.

OSIRIS-REx arrived at Bennu in 2018.

The spacecraft found traces of hydrogen and oxygen molecules - part of the recipe for water and thus the potential for life - embedded in the asteroid's rocky surface, said Dante Lauretta, the OSIRIS-REx mission's principal investigator, in 2018.

The trip back to Earth will take about two years.

The asteroid, named Bennu, is about the size of the Empire State Building in New York

The spacecraft will then eject a capsule containing the asteroid samples, which NASA says will land in a remote area of Utah.

NASA says samples will be distributed to research laboratories worldwide, but 75% of the samples will be preserved at the Johnson Space Centre in Houston for future generations to study with technologies not yet created.

The roughly $800 million, minivan-sized OSIRIS-REx spacecraft, built by Lockheed Martin, launched in 2016 to grab and return the first US sample of pristine asteroid materials.

Japan is the only other country to have accomplished such a feat.

Asteroids are among the leftover debris from the solar system's formation some 4.5 billion years ago.

Scientists say a sample could hold clues to the origins of life on Earth.