The comet, known as Siding Spring (C/2013 A1), made its closest encounter with Mars today at 2:27 pm (1827 GMT), racing past the Red Planet at a dazzling 203,000 kilometers per hour.
At its closet, Siding Spring was 139,500 kilometers from Mars -- less than half the distance between Earth and our moon.
"Signal confirming closest approach has just been received," the European Space Agency said on Twitter.
Before the comet passed, it could be seen in space racing toward the bright planet, trailed by a tail of debris.
The comet is around a mile wide and is only about as solid as a pile of talcum powder.
NASA's fleet of Mars-orbiting satellites and robots on the planet's surface were primed for the flyby of the comet, hoping to photograph the rare event.