The Andromeda Galaxy (/ænˈdrɒmᵻdə/), also known as Messier 31, M31, or NGC 224, is a spiral galaxy approximately 780 kiloparsecs (2.5 million light-years) from Earth. It is the nearest major galaxy to the Milky Way and was often referred to as the Great Andromeda Nebula in older texts. It received its name from the area of the sky in which it appears, the constellation of Andromeda, which was named after the mythological princess Andromeda.
Andromeda is approximately 220,000 light years across, and it is the largest galaxy of the Local Group, which also contains the Milky Way, the Triangulum Galaxy, and other smaller galaxies. Despite earlier findings that suggested that the Milky Way contains more dark matter and could be the largest in the grouping, the 2006 observations by the Spitzer Space Telescope revealed that Andromeda contains one trillion (1012) stars: at least twice the number of stars in the Milky Way, which is estimated to be 200–400 billion. The mass of the Andromeda Galaxy is estimated to be 1.5×1012 solar masses, while the Milky Way is estimated to be 8.5×1011 solar masses.
The Milky Way and Andromeda galaxies are expected to collide in 3.75 billion years, eventually merging to form a giant elliptical galaxy  or perhaps a large disc galaxy. The apparent magnitude of the Andromeda Galaxy, at 3.4, is among the brightest of the Messier objects, making it visible to the naked eye on moonless nights, even when viewed from areas with moderate light pollution.
In the year 964, the Persian astronomer Abd al-Rahman al-Sufi described the Andromeda Galaxy, in his Book of Fixed Stars as a “nebulous smear”. Star charts of that period labeled it as the Little Cloud. In 1612, the German astronomer Simon Marius gave an early description of the Andromeda Galaxy based on telescopic observations. In 1764, Charles Messier catalogued Andromeda as object M31 and incorrectly credited Marius as the discoverer despite it being visible to the naked eye. In 1785, the astronomer William Herschel noted a faint reddish hue in the core region of Andromeda. He believed Andromeda to be the nearest of all the “great nebulae”, and based on the color and magnitude of the nebula, he incorrectly guessed that it is no more than 2,000 times the distance of Sirius. In 1850, William Parsons, 3rd Earl of Rosse, saw and made the first drawing of Andromeda’s spiral structure.
In 1864, William Huggins noted that the spectrum of Andromeda differs from a gaseous nebula. The spectra of Andromeda displays a continuum of frequencies, superimposed with dark absorption lines that help identify the chemical composition of an object. Andromeda’s spectrum is very similar to the spectra of individual stars, and from this it was deduced that Andromeda has a stellar nature. In 1885, a supernova (known as S Andromedae) was seen in Andromeda, the first and so far only one observed in that galaxy. At the time Andromeda was considered to be a nearby object, so the cause was thought to be a much less luminous and unrelated event called a nova, and was named accordingly; “Nova 1885”.
In 1887, Isaac Roberts took the first photographs of Andromeda, which was still commonly thought to be a nebula within our galaxy. Roberts actually mistook Andromeda and similar spiral nebulae as solar systems being formed. In 1912, Vesto Slipher used spectroscopy to measure the radial velocity of Andromeda with respect to our solar system—the largest velocity yet measured, at 300 kilometres per second (190 mi/s).
Content retrieved from: https://en.wikipedia.org/wiki/Andromeda_Galaxy.