As Halloween trick-or-treating preparations were underway Saturday afternoon, a dead comet bearing remarkable resemblance to a massive human skull hurtled safely past Earth.

The comet was originally thought to be a giant asteroid, but NASA scientists observing it have determined it is more than likely a dead comet that shed its volatiles after numerous passes around the sun.

Dubbed "the Great Pumpkin" by NASA's Jet Propulsion Laboratory, the space object, designated 2015 TB145, has a diameter of 400 metres, twice the size of the Rogers Centre in Toronto, and is travelling through space at the dizzying speed of 35 kilometres per second.

"It appears to have donned a skull costume for its Halloween flyby," NASA said on its website.

A frightening aspect of the space rock, which has also been nicknamed "Spooky," is that astronomers didn't even know it existed until Oct. 10 — not nearly enough time to stop it if it posed a threat — and almost didn't spot it at all.

The Great Pumpkin passed within 490,000 kilometres of the Earth on Saturday at about 1 p.m. ET — 1.3 times as far away as the moon.