<Tr> <Th> Distance </Th> <Td> 4,951 km (3,076 mi) </Td> </Tr> <Tr> <Td_colspan="2"> Flagship ← Viking 2 Voyager 1 → </Td> </Tr> <P> Voyager 2 is a space probe launched by NASA on August 20, 1977, to study the outer planets . Part of the Voyager program, it was launched 16 days before its twin, Voyager 1, on a trajectory that took longer to reach Jupiter and Saturn but enabled further encounters with Uranus and Neptune . It is the only spacecraft to have visited either of the ice giants . </P> <P> Its primary mission ended with the exploration of the Neptunian system on October 2, 1989, after having visited the Uranian system in 1986, the Saturnian system in 1981, and the Jovian system in 1979 . Voyager 2 is now in its extended mission to study the outer reaches of the Solar System and has been operating for 40 years, 2 months and 24 days as of November 13, 2017 . It remains in contact through the Deep Space Network . </P>

What was the purpose of the voyager 2 mission