A spacecraft taking the scenic route to Mercury successfully completed a crucial maneuver on its journey: a precisely choreographed swing past Earth.

The spacecraft, BepiColombo , represents a partnership between the European Space Agency (ESA) and the Japan Aerospace Exploration Agency (JAXA). The mission launched in October 2018 , but its destination, Mercury, is very challenging to reach: Achieving orbit around the innermost planet requires a seven-year trajectory including complex planetary acrobatics in the form of a total of nine flybys.

BepiColombo executed the first of those nine flybys — the only one of its planet of origin — today (April 10) at 12:25 a.m. EST (425 GMT). The spacecraft came 7,887 miles (12,693 km) away from Earth , approaching at an angle designed to slightly reduce its speed with respect to the sun. That adjustment will allow BepiColombo to head deeper into the solar system.

Related: A radar station in Puerto Rico can see ice on Mercury

BepiColombo is now out of Earth's shadow, and basking once again in sunlight!#FLYBYSUCCESS#EclipseEnds#BepiColomboEarthFlyby pic.twitter.com/szH2fwLuGWApril 10, 2020

The spacecraft's next dance will be with Venus , which BepiColombo will approach in October. The probe will loop around Earth's evil twin twice, this year and next, in order to further reduce its speed and put itself on track to meet its target, Mercury.

But even with three planetary adjustments, the trajectory to a successful Mercury stay is tricky. BepiColombo will conduct a series of six Mercury flybys between 2021 and 2025 before the small planet's gravity finally traps the probe in December 2025.

Once BepiColombo arrives at Mercury , it will split into two constituent spacecraft: JAXA's Mercury Magnetospheric Orbiter and ESA's Mercury Planetary Orbiter. The first probe will orbit relatively high above Mercury's surface and focus on studying the magnetosphere, the region of space governed by the planet's magnetic field . Scientists are excited for this research because, before spacecraft visited Mercury, experts didn't think the planet should be able to create a magnetic field. And the phenomenon remains confusing today.

The second BepiColombo probe will approach closer to Mercury's surface, and although it will contribute some magnetosphere measurements, it will focus on analyzing the planet's composition. Scientists hope this work will help them understand how Mercury — and, in turn, the entire solar system — formed.

Once BepiColombo arrives at its target, it will be just the third mission to study Mercury up close, which given its proximity to the sun is both a difficult target and a scorchingly hot one. NASA's Mariner 10 spacecraft flew past the tiny world three times in the 1970s; NASA's Messenger spacecraft orbited Mercury from 2011 to 2015. Each BepiColombo spacecraft's primary mission will last for one year.