Astronomers measured the motion of Andromeda, also known as M31, which is currently 2.5m light years away but is spiralling towards the Milky Way.

"[The galaxy] is inexorably falling toward the Milky Way under the mutual pull of gravity between the two galaxies and the invisible dark matter that surrounds them both," Nasa said.

Nvidia's GPU's and Kepler technology were recently used to simulate the collision:

Nasa's scientists welcomed the news, and said it ended 100 years of speculation.

"After nearly a century of speculation about the future destiny of Andromeda and our Milky Way, we at last have a clear picture of how events will unfold over the coming billions of years," said Roeland van der Marel of the Space Telescope Science Institute (STScI) in Baltimore.

According to Nasa it will be 2bn years after the galaxies hit before they completely merge and reform into a single, larger, galaxy.

While pictures of galaxies make them appear very tightly packed, in reality the space between stars is so vast they are extremely unlikely to collide with each other.

Instead, Nasa says, the stars will be thrown into different orbits around the new galactic center.

After the collision things get even more complicated, Nasa said - as yet another galaxy (the Triangulum galaxy, M33) will also join the party and slam into the merging pair.

A century ago astronomers did not know that Andromeda was a different galaxy to our own that M31 was a separate galaxy far beyond the stars of the Milky Way. Edwin Hubble measured its vast distance by uncovering a variable star that served as a "milepost marker".

"In the worst-case-scenario simulation, M31 slams into the Milky Way head-on and the stars are all scattered into different orbits," said Gurtina Besla of Columbia University in New York. "The stellar populations of both galaxies are jostled, and the Milky Way loses its flattened pancake shape with most of the stars on nearly circular orbits.

"The galaxies' cores merge, and the stars settle into randomised orbits to create an elliptical-shaped galaxy."

59 Incredible Space Photos

59 Incredible Space Photos

1

of

59

Dusty Space Cloud

This image shows the Large Magellanic Cloud galaxy in infrared light as seen by the Herschel Space Observatory, a European Space Agency-led mission with important NASA contributions, and NASA's Spitzer Space Telescope. In the instruments' combined data, this nearby dwarf galaxy looks like a fiery, circular explosion. Rather than fire, however, those ribbons are actually giant ripples of dust spanning tens or hundreds of light-years. Significant fields of star formation are noticeable in the center, just left of center and at right. The brightest center-left region is called 30 Doradus, or the Tarantula Nebula, for its appearance in visible light.