A comet will buzz Mars this Sunday (Oct. 19) in an epic encounter that has astronomers around the world tingling with excitement.

Comet Siding Spring, also known as C/2013 A1, will miss the Red Planet by just 87,000 miles (140,000 kilometers) at 2:27 p.m. EDT (1827 GMT) on Sunday. For comparison, the moon orbits Earth at an average distance of 239,000 miles (384,600 km).

While the comet won't put on a show for skywatchers here on Earth, the fleet of robotic explorers at Mars will get an eyeful. They will study the comet, as well as any observable interactions between its shed particles and the thin Martian atmosphere. [See photos of Comet Siding Spring]

Comets are icy leftovers from the solar system's birth, and Siding Spring is a pristine object that has never been "heat-treated" by the sun before. So any insights about the comet's composition and behavior could help researchers better understand how our cosmic neighborhood began taking shape 4.6 billion years ago.

"This is a cosmic science gift that could potentially keep on giving, and the agency's diverse science missions will be in full receive mode," former astronaut John Grunsfeld, associate administrator for NASA's Science Mission Directorate, said in a statement. "This particular comet has never before entered the inner solar system, so it will provide a fresh source of clues to our solar system's earliest days."

All five operational spacecraft orbiting the Red Planet — NASA's Mars Odyssey, Mars Reconnaissance Orbiter and MAVEN probes, India's Mangalyaan spacecraft and Europe's Mars Express — will observe the flyby. And NASA's Opportunity and Curiosity rovers will crane their necks up to watch from the Martian surface as well.

The Siding Spring observation campaign is not restricted to the close Mars approach on Sunday. A number of different instruments on the ground and in space have already been observing Siding Spring, and they'll continue to do so after the comet leaves the Red Planet in its rear-view mirror. A primary goal is to see how a pristine comet changes as it gets closer and closer to the sun.

There is no chance that Siding Spring will hit Mars during the flyby, and analyses suggest that material shed by the comet poses little danger to orbiting spacecraft. (Opportunity and Curiosity will definitely be fine, protected as they are by Mars' air.) But NASA is taking precautions anyway; the space agency has maneuvered its orbiters to make sure they'll be on the safe side of the planet when Mars gets closest to Siding Spring's dust tail, officials have said.

The mountain-size Siding Spring spends most of its time in the Oort Cloud, a frigid comet repository that lies perhaps 50,000 astronomical units (AU) from the sun. (One AU is the distance from Earth to the sun — about 93 million miles, or 150 million km).

Scientists think Siding Spring's multimillion-year orbit has never taken it closer to the sun than the realm of the giant planets (Saturn, Jupiter, Uranus and Neptune). So the comet's current journey is something special — something to marvel at for several different reasons, researchers said.

"This comet got knocked into the inner [solar] system by the passage of a star near the Oort Cloud. So, think about a comet that started its travel probably at the dawn of man, and it's just coming in close now," ‪Carey Lisse, a senior astrophysicist at Johns Hopkins University Applied Physics Laboratory in Laurel, Maryland, said during a news conference on Thursday (Oct. 9).

"The reason we can actually observe it is because we have built satellites and rovers, and we've now got outposts around Mars," Lisse added. "That's pretty exciting."

Follow Mike Wall on Twitter @michaeldwall and Google+. Follow us @Spacedotcom, Facebook or Google+. Originally published on Space.com.