The Milky Way is on course to collide head-on with another galaxy, Hubble observations have confirmed. Our home city of stars will be mown down by larger neighbour M31 in Andromeda.

But the good news is that it won’t happen for four billion years. And in any case, the event will pose no danger to our Sun in its old age, even though forces will send the Solar System flying in a new direction through space.

That is because there is so much space between individual stars that they will miss hitting each other. But powerful tidal effects caused by gravity will pull both galaxies, each containing many billions of stars, into new shapes.

NASA’s astronomers have long known that M31 is heading in our general direction. But they are now certain that there will be a direct collision, thanks to years of painstaking observations made with the Hubble space telescope.

Sangmo Tony Sohn, of NASA’s Space Telescope Science Institute (STScI) in Baltimore, USA, said: “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.”

Space scientists made precise measurements, over up to seven years, of the motions of stars inside M31 which currently lies 2.5 million light-years away from us. Their results showed it is steadily falling towards the Milky Way at a speed of 400,000 kilometres per hour (250,000 mph). What is more, another smaller galaxy in our part of the Universe, called M33, will also join in the cosmic pile-up at around the same time.

Astronomer Gurtina Besla, of Columbia University, New York, said: “In the worst-case-scenario simulation, M31 slams into the Milky Way head-on and the stars are all scattered into different orbits. 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 randomized orbits to create an elliptical-shaped galaxy.”

NASA simulations using powerful computers show that once M31 and the Milky Way meet, it will take a further two billion years for the galaxies to merge completely under the the pull of gravity. The individual galaxies will lose their familiar spiral patterns and turn into a single more featureless mass of stars called an elliptical galaxy.

Despite the dramatic nature of the event, any life still existing on Earth four billion years ahead would be unlikely to notice any ill effects due to the vast distances between stars already. The Sun is already racing through space at 240 km (150 miles) per second, but we don’t actually feel that we are moving.

What will happen is that over the next four billion years, the Andromeda galaxy, which is already visible with the naked eye on a clear, dark night, would loom larger and larger in the sky until it resembled another stretch of the Milky Way.

Eventually we would be able to make out the individual stars in the galaxy without a telescope and they would spread across the heavens to fill the gaps between the stars already forming our own constellations of the time.

A simulation of the galactic collision. Credit: NASA, ESA, and F. Summers (STScI)

Astronomers believe that few if any individual stars will collide. Instead they will whizz safely past each other at great distances. But clouds of gas and dust from the two galaxies – and M33 when it joins the scrap – will merge and fall together to produce new generations of stars.

Also the supermassive black hole that lies at the heart of the Milky Way will merge with a similar one at the centre of the Andromeda galaxy, creating an even more powerful and hungry cosmic cannibal. Three papers about the merger are to be published in the Astrophysical Journal.

Galaxy collisions are common throughout the Universe and examples have been beautifully photographed by Hubble before. Astronomers have also previously detected the remnants of other smaller galaxies that M31 ate for breakfast.

Leading British astronomy writer Dr Stuart Clark told Skymania: “It’s dog eat dog for galaxies. They’re all cannibals. Our Milky Way grew to the size it is today by swallowing smaller galaxies hundreds of millions of years ago. Now it is going to meet its match in the form of the Andromeda galaxy, M31.

“People of the future will get the spectacular sight of a second Milky Way in the sky and then the whole of the heavens will be filled with stars as they are thrown around all over the place.”

Related: Andromeda galaxy is an electric sight

★ Keep up with space news and observing tips. Click here to sign up for alerts to our latest reports. No spam ever - we promise!