The stardust, or particles from the tail of the comet, Wild 2, will be returned to Earth in 2006 for study by scientists.
The control room at NASA's Jet Propulsion Laboratory in Pasadena erupted in cheers and clapping at 11:40 (19:40 GMT) as monitors showed an uninterrupted flow of data from the Stardust spacecraft during its closest encounter point with the comet.
"We've flown through the worst of it and we're still in contact with our spacecraft." JPL project manager Tom Duxbury said moments after the encounter. "We're still exuberant. What a deal."
Duxbury said the bookcase-sized spacecraft performed flawlessly during the intense, eight-minute hailstorm of particles inside Wild 2's coma, or tail.
The historic "fly-by" happened 390 million km (242 million miles) from Earth after a five-year journey when Stardust passed within 303 kms (188 miles) of Wild 2.
Initial data from the encounter showed that the spacecraft's systems functioned as planned - snapping pictures of the comet's nucleus and scooping up dust particles destined to be the first cometary samples returned to Earth for study.
A capsule carrying the samples will ultimately separate from the spacecraft and reenter Earth's atmosphere for a landing in the Utah desert in January 2006, while Stardust veers back into space.
Scientists say the dust samples, containing particles gathered by the comet since its formation at the dawn of the solar system and during its own ancient interplanetary wanderings, may hold clues to how the solar system, and even life on Earth, began.