The distinctive spiral arms of the Milky Way galaxy were formed through two collisions with a nearby dwarf galaxy, a new study suggested.

In the last two billion years, a dwarf galaxy Sagittarius crashed into the Milky Way through a rival orbital path, leading to dramatic consequences, according to the study published in the journal Nature on Thursday.

The collision could have triggered the formation of the spiral arms of the Milky Way, causing the flaring in the outermost disk and affecting the growth of its central bar.

The dwarf galaxy is located on the other side of the Milky Way close to the plane of the disk, making it difficult to observe.

The encounters with the Milky Way ripped Sagittarius apart, causing the dwarf galaxy to send large amounts of its stars and dark matter spinning off into the new galactic arms. Around 80 to 90 per cent of its dark matter was stripped off, according to lead author Chris Purcell, an astrophysicist at the University of Pittsburgh.

Sagittarius was among the largest of the Milky Way's dwarf satellites before it began to be torn apart by galactic tides, but objects on that scale are still relatively small details in the eyes of many galaxy-formation theorists, Purcell said.

It had always been assumed that the Milky Way had evolved relatively unperturbed over the past few billion years in terms of its global structure and appearance.

Purcell and his colleagues created the most accurate simulation yet of the effects of the collision, seen in the videos below.

The first impact of the collision caused some stars to orbit in a variety of ellipse instead of orbiting in circles, thus forming clusters of stars and gas spinning in a spiral pattern.

The second impact turned the spirals become to be remarkably similar to those seen in the Milky Way, while preserving the central bar.

The ring-like structures around the Milky Way were also generated through the collisions.

In the absence of a Sagittarius-type satellite, the simulated galaxy remained a flat disk.

The work is impressive because it reproduces many of the features we can actually see, said Steve Majewski, an astronomer at the University of Virginia in Charlottesville. That's never been done before.

We may well learn to generally view intermediate-scale spirality in systems like the Milky Way as transient symptoms of recent impacts involving satellites too faint to see, Purcell told Space.com.

Future observations of nearby galaxies may even begin to discern the brightest of such companions, which will help solidify the phenomenological link between minor mergers and spiral arms.