An astrophotographer captured a long-exposure image of a megacomet glowing in the dark on June 18, just before its closest approach to Earth.

Comet C/2017 K2 (PANSTARRS), also known as K2, will pass by our planet on Wednesday (July 13), passing nearly twice as far away as our planet is from the sun. However, the comet, which could be 100 miles (160 kilometers) wide, is still spewing enough dust to be visible through telescopes.

"Look for a six-inch coma," advised by galacticimages.com, John Chumack, who discovered the massive comet in the constellation Ophiuchus from a dark location in Yellow Springs, Ohio.

Comets are composed of ice and dust that were left behind from the early solar system. A comet becomes active when it approaches the sun because its ice begins to melt and form a coma, which is an envelope. However, the type of ice a comet contains, such as water, carbon dioxide, or carbon monoxide, greatly influences the distance from the sun at which a comet becomes active.

The comet was near the celestial equator in the constellation Ophiuchus when Chumack photographed it. He added that it was visible through a six-inch reflector and an eight-inch Schmidt-Cassegrain telescope.

Chumack added that the beauty shot was taken with a slightly larger 12-inch F4 Newtonian reflector. A Bisque ME mount and a modified Canon 6D DSLR camera were also used in the 31-minute exposure.

When Chumack first captured K2 on video, he assessed its magnitude to be 9.7, and according to EarthSky, the comet might become as brilliant as magnitude 7 by the end of 2022. While the comet would be harder to spot since it is diffuse, magnitude 6 is roughly the dimmest star visible to the naked eye.

K2 likely started its trip in the spherical Oort Cloud, which surrounds the solar system and is nearly a light-year across and home to hundreds of billions of comets. The comet's makeup may mirror conditions in the early solar system, before planets formed, as it is entering the system for the first time.

K2 was discovered in May 2017 by researchers using data from the Panoramic Survey Telescope and the Rapid Response System (Pan-STARRS). The new Hubble view allowed Jewitt's team to measure the nucleus of K2 and confirm that it hasn't yet developed a comet's signature tail.

They also found K2 in earlier images taken by the Canada-France-Hawaii Telescope (CFHT) in Hawaii in 2013; according to the statement, no one had noticed the incredibly faint object at the time, but Jewitt's team was able to identify the comet and its growing coma of material.