The Andromeda galaxy, our Milky Way's closest neighbor, is the most distant object in the sky that you can see with your unaided eye — but only on a clear night from a location with a very dark sky. The galaxy is a beautiful spiral, but one fact you may not be aware of: We’re safe for a few billion years, but Andromeda is headed our way and on a collision course with the Milky Way.

Andromeda's close proximity to Earth — at only 2.5 million light-years away — makes it a convenient target to observe for extrapolations about other spiral galaxies. In recent years, scientists have done detailed studies of black holes, stars and other objects within the galaxy. This included a stunning mosaic of Andromeda galaxy images taken by the Hubble Space Telescope in 2015.

Location, location, location

This mosaic of M31 merges 330 individual images taken by the Ultraviolet/Optical Telescope aboard NASA's Swift spacecraft. It is the highest-resolution image of the galaxy ever recorded in the ultraviolet. The image shows a region 200,000 light-years wide and 100,000 light-years high (100 arcminutes by 50 arcminutes). (Image credit: NASA/Swift/Stefan Immler (GSFC) and Erin Grand (UMCP))

The visible fuzzy patch of stars stretches about as long as the width of the full moon, and half as wide; only with significant magnification can you tell it stretches six times that length in fullness.

A spiral galaxy like the Milky Way, Andromeda contains a concentrated bulge of matter in the middle, surrounded by a disk of gas, dust, and stars and an immense halo. Though Andromeda contains approximately a trillion stars to the 250 billion in the Milky Way, our galaxy is actually more massive, because it is thought to contain more dark matter. [Andromeda Galaxy Photos: Amazing Pictures of M31]

Collision course

Artist's conception of the Milkomeda galaxy a trillion years from now. (Image credit: David A. Aguilar (CfA))

Andromeda and the Milky Way are heading on a collision course that will alter the structure of the two galaxies forever. The galaxies are rushing closer to one another at about 70 miles per second (112 kilometers per second). Astronomers estimate that Andromeda will collide with the Milky Way in 4 billion years, with the merger concluding 6 billion years from now. By that time, the sun will have swollen into a red giant and swallowed up the terrestrial planets, so Earth will have other things to worry about. [Milky Way Galaxy's Head-On Crash with Andromeda in Pictures (Gallery)]

Still, the fresh influx of dust should boost star formation in the new "Milkomeda" galaxy, and the Earthless sun may well leave the Milky Way for good. After a messy phase, where arms project crazily from the combined pair, the two should settle into a smooth elliptical galaxy.

Galaxy collisions are a normal part of the universe's evolution. In fact, both Andromeda and the Milky Way bear signs of having already crashed into other galaxies. Andromeda boasts a large ring of dust in its center, giving it an interesting shape. Astronomers believe this dust may have formed when it swallowed an existing galaxy.

Early observational history

In 964, the Persian astronomer Abd al-Rahman al-Sufi described the galaxy as a "small cloud" in his "Book of Fixed Stars," the first known report of our nearest neighbor. When Charles Messier labeled it M31 in 1764, he incorrectly credited the discovery of what was then called a nebula to the German astronomer, Simon Marius, who provided the first telescopic observation of the object. The first photographs of Andromeda were taken in 1887, by Isaac Roberts.

This image of the Andromeda Galaxy is a composite of an infrared photo from ESA's Herschel space telescope and the XMM-Newton’s X-ray telescope. The infrared frame shows rings of dust that trace gaseous reservoirs where new stars are forming and the X-ray image shows stars approaching the ends of their lives. (Image credit: ESA/Herschel/PACS/SPIRE/J.Fritz, U.Gent/XMM-Newton/EPIC/W. Pietsch, MPE)

In the 1920s, the distant galaxy became part of the Great Debate between American astronomers Harlow Shapley and Heber Curtis. At the time, astronomers thought the Milky Way composed the whole universe, and the strange patches known as nebulae lay inside of them. Curtis had spotted various novae in Andromeda, and argued instead that it was a separate galaxy.

The discussion wasn't concluded until 1925, when Edwin Hubble identified a special kind of star known as a Cepheid variable — a star whose characteristics allow for precise measurements of distance — within Andromeda. Because Shapley had previously determined that the Milky Way was only 100,000 light-years across, Hubble's calculations revealed that the fuzzy patch was too far away to lie within the Milky Way.

Hubble went on to use his measurements of the Doppler shifts of the galaxies to determine that the universe was expanding. The calculated distance to Andromeda doubled in the 1940s when Walter Baade was the first to observe individual stars in the central region of the galaxy, and found two different types of Cepheid variables. Radio maps of Andromeda followed in the 1950s, after radio emissions were detected by Hanbury Brown and Cyril Hazard at Jodrell Bank Observatory.

Recent Andromeda discoveries

Our understanding of the size of the Andromeda galaxy has grown bigger in recent years. In 2015, observations from the Hubble Space Telescope found that a halo of material surrounding Andromeda is six times larger and 1,000 times more massive than what was previously measured. (At the time, astronomers said the Milky Way may have a halo as well — and perhaps the two galaxies' halos are already starting to merge.) This follows on from revised size estimates in 2005 and 2007, based on observing stars and star motions.

In 2015, scientists released the most detailed photo of Andromeda ever using a mosaic of images from the Hubble Space Telescope. The image included 7,398 exposures taken over 411 pointings of the telescope. The image revealed more than 100 million stars within the galaxy, as well as dust structures and other features. At the time, scientists said the images would help with extrapolating the structure of spiral galaxies that are even farther from Earth, making them more difficult to view in such detail.

Black hole activities within Andromeda also came under scrutiny. In late 2017, scientists unexpectedly found two supermassive black holes closely orbiting each other. At the time, the research team said these black holes were likely the "most tightly coupled" of any supermassive ones known.

A search using NASA's Chandra X-Ray Telescope yielded 26 black hole candidates in Andromeda in 2013, making this the biggest catch of such candidates ever found in another galaxy besides our own Milky Way. Another 40 black holes were tracked down in 2016 using NASA's Nuclear Spectroscopic Telescope Array (NuSTAR), which specializes in X-ray observations.

Scientists tracked down a probable pulsar — a dead star that spins rapidly — in Andromeda in 2017. The X-ray source was first cataloged by NASA's Swift satellite as object Swift J0042.6+4112, and then characterized by NuSTAR. The newer observations found that this object's spectrum of light appears similar to pulsars in the Milky Way.

Other miscellaneous discoveries in Andromeda include tracking star birth and death in infrared wavelengths in 2011; discovering gamma-ray radiation in 2017 that could be an indication of dark matter, a substance that is only known through its effects on "ordinary" matter such as galaxies; and spotting a ring of dwarf galaxies around Andromeda in 2013 — something that could also be present around the Milky Way.

Additional reporting by Elizabeth Howell, Space.com contributor

Correction: This article was updated on March 11, 2019 to include the correct estimated number of stars in the Milky Way.