Stardust was the fourth of NASA's Discovery Program of low cost exploration missions (after NEAR, Mars Pathfinder and Lunar Prospector). The primary goal of the Stardust mission was to collect interstellar dust and carbon-based samples of 10 microns or less from the nucleus of comet Wild-2 (pronounced Vilt-2) during its closest encounter and return them back to Earth for analysis.

While in flight, Stardust also collected samples of interstellar dust grains. Stardust collected the samples using a low-density microporous silica-based substance known as Aerogel.

The spacecraft was launched into heliocentric orbit and performed midcourse corrections on 28 December 1999 and 18 January, 20 January and 22 January 2000. Its first interstellar dust collection operation was carried out between 22 February and 1 May 2000. After approximately a year in heliocentric orbit, Stardust flew by Earth for a gravity-assist (closest approach to Earth was at 11:13 UT on 15 January 2001 at a range of 6,012 km) to send it on a second sample-collection exercise between July and December 2002.

Stardust encountered comet Wild-2 on 2 January 2004, when the spacecraft flew 236 km (about 147 miles) from Wild-2. The flyby yielded the most detailed, high-resolution comet images taken to date.

The spacecraft approached Earth on 15 January 2006 and jettisoned the capsule containing particles from the comet and interstellar dust. The capsule landed safely and on-target, 73-miles southwest of Salt Lake City, Utah, within the Utah Test and Training Range on the US Army Dugway Proving Grounds, completing the world's first sample return from a comet. The spacecraft, responding to commands from the mission's navigators, flew past Earth and began an orbit around the sun that would bring it near the planet every 3 years.

In May 2009, NASA repurposed the spacecraft to to fly past comet Tempel 1 to collect images and other scientific data improving upon the data set previously collected by Deep Impact. The Stardust spacecraft traveled about 21 million km (13 million miles) in its journey about the sun in the weeks following the 14 February 2011 comet Tempel 1 flyby, making the grand total from launch to its final rocket burn about 5.69 billion km (3.54 billion miles).