Thanks to powerful images from the Hubble Space Telescope and a trick of light and gravity, astronomers have confirmed the existence of a gas giant planet that orbits a pair of stars near the centre of our galaxy.

The planet is 8,000 light-years away from Earth and orbits twin red dwarf stars roughly every seven years, according to a new study to be published in the The Astronomical Journal.

It's not the first time astronomers have found planets that orbit two stars — like Star Wars' Tatooine — but this is the first one discovered using a light-bending technique known as gravitational microlensing.

It was first spotted in 2007 by researchers with the Optical Gravitational Lensing Experiment (OHLE), which searches for and observes effects from small distortions of spacetime caused by stars and exoplanets.

It was discovered via gravitational microlensing, which relies on the concept from Einstein's Theory of Relativity that gravity can bend light waves.

When a bright, distant star is viewed from Earth, the gravity from a "lens star" between the Earth and the distant "source star" can bend light and act as a lens. The lens star bends the light from the source star into magnified images of the source star on either side of it.

While the researchers knew they'd discovered a three-body system, they couldn't be sure exactly what it was made comprised of.

"The ground-based observations suggested two possible scenarios for the three-body system: a Saturn-mass planet orbiting a close binary star pair or a Saturn-mass and an Earth-mass planet orbiting a single star," David Bennett of the NASA Goddard Space Flight Center in Greenbelt, Md. and the paper's first author, said in a statement.

Now, thanks to the crisp images from the Hubble spacecraft, scientists have pinpointed the twin red dwarf stars.

"We were helped in the analysis by the almost perfect alignment of the foreground binary stars with the background star, which greatly magnified the light and allowed us to see the signal of the two stars," Bennett said.

Massive orbit

NASA's Kepler spacecraft has so far discovered 10 other planets orbiting binary stars — but this one stands out both for the unique way it was discovered and for its vast orbit.

The planet orbits about 483 million kilometres from the stellar duo. The stars are about 11 million kilometres apart, a distance roughly 14 times the diameter of the moon's orbit around Earth.

"This discovery suggests we need to rethink our observing strategy when it comes to stellar binary lensing events," Yiannis Tsapras, co-author of the study from the Astronomisches Rechen-Institut (Astronomical Calculation Institute) in Heidelberg, Germany, said. "This is an exciting new discovery for microlensing."

In 2014, astronomers used gravitational microlensing to discover an Earth-sized planet that shared a system with two mini-suns, but in that case it orbited just one of the twins.

Thursday's news comes on the heels of a University of Edinburgh study that revealed two-star systems are more common that previously believed.