Astronomers have discovered a planet orbiting two stars 8,000 light years from Earth, NASA announced on Thursday.

While the system was first found in 2007, at that time experts were uncertain whether it contained one planet and two stars, or two planets and one star.

"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, said in a statement.

Using the Hubble Space Telescope and a technique called gravitational microlensing, they’ve figured out that it’s the first scenario: one big planet and two stars. The space agency said that this is the first time that the gravitational microlensing strategy has been used to confirm the makeup of a three-body system like this one.

Related:

The technique utilized the effect of a star behind the stars they wanted to study to help them figure out that the system had two stars, not one.

"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 added, in the statement.

The two stars are both red dwarfs, and are about seven million miles apart from each other. About 300 million miles away is the gas giant planet that orbits them, and it takes about seven Earth years to go around once.

This isn’t the first time that scientists have discovered a planet orbiting twin stars— a configuration sometimes compared to the planet Tatooine from "Star Wars."

Follow Rob Verger on Twitter: @robverger