A comet the size of a small mountain and about as solid as a pile of talcum powder whizzed past Mars on Sunday, dazzling space enthusiasts with the once-in-a-million-years encounter.
The comet, known as Siding Spring, made its closest encounter with the Red Planet at 1827 GMT, racing past it at a breakneck 203,000 kilometres (126,000 miles) per hour.
At its closest, Siding Spring was 140,000 kilometres from Mars -- a near miss by astronomers' standards.
Before the comet buzzed Mars, it could be seen in space racing toward the brightly illuminated planet trailed by a cloud of debris.
Scientists said the passing of the comet -- also known as C/2013 A1 and about a mile wide -- offered a unique chance to study its impact on Mars's atmosphere.
"What could be more exciting than to have a whopper of an external influence like a comet, just so we can see how atmospheres do respond?" asked Nick Schneider, the remote sensing team leader from NASA's MAVEN mission to Mars.
"It's a great learning opportunity."
NASA's fleet of Mars-orbiting satellites and robots on the planet's surface were primed for the flyby, hoping to capture the rare event and collect a trove of data for Earthlings to study.
MAVEN, NASA's latest Mars orbiter, reported back to Earth in "good health" after spending about three hours ducking a possible collision with the comet's high-velocity dust particles, the US space agency said.
"We're glad the spacecraft came through, we're excited to complete our observations of how the comet affects Mars, and we're eager to get to our primary science phase," said MAVEN principal investigator Bruce Jakosky.
"Mars Odyssey hard at work now to image #MarsComet Siding Spring, after closest approach and before dust tail hits," NASA said on Twitter, referring to one of its robotic spacecraft.
Duck and cover
The comet -- a ball of ice, dust and pebbles -- is believed to have originated billions of years ago in the Oort Cloud, a distant region of space at the outskirts of the solar system.
As it hurtled through space it created a meteor shower and shed debris which scientists had feared could damage valuable spacecraft.
"All it takes is a little tiny grain of sand traveling at that speed and you've got damage to solar arrays, or your propulsion line or critical wires," said Schneider.
Before the comet entered the Red Planet's orbit, NASA moved its Mars Reconnaissance Orbiter, Mars Odyssey and MAVEN to avoid damage by the comet's high-speed debris.
All three orbiters later reported back with a clean bill of health after taking shelter behind Mars, NASA said.
The comet travelled more than one million years to take its first pass by Mars, and will not return for another million years, after it completes its next long loop around the sun.
The comet was discovered by Robert McNaught at Australia's Siding Spring Observatory in January 2013.
Its flyby of Mars was not likely to be visible to sky watchers on Earth.