The dazzling globular stellar cluster known as NGC 6397 shines in this image. This dense collection of stars is one of about 150 globular clusters that orbit outside of our Milky Way galaxy's starry disk, and they are much older than the stars inside the disk.

Astronomers are constantly searching for better ways to figure out how far away objects in the sky are. Recently, for the first time, scientists measured the distance to one of the oldest collections of stars in the universe with great precision, thanks to two years of data from the Hubble Space Telescope.

The new method to determine distance from Earth could help scientists estimate the age of the universe, the researchers said in a statement from the Space Telescope Science Institute (STScI) in Baltimore.

Found in the constellation Ara, the 400,000 stars of globular cluster NGC 6397 are thought to have emerged shortly after the Big Bang. The ancient congregation of stars outside the Milky Way's disk is one of the closest objects of its kind to Earth.

The new measurement acts as a yardstick in the skies, because it anchors distances for further research, according to the space agencies. [Hubble Expands Skywatching List for Messier Marathoners with New Photos]

The researchers said the new measurement is within just a 3 percent margin of error, and they determined the distance between NGC 6397 and Earth to be 7,800 light-years. To put the value of the new work in perspective, officials said that the existing measuring models had margins of error ranging from 10 percent to 20 percent.

And the research team at STScI may soon get down to a 1 percent margin of error, if the Hubble measurement for this collection of stars matches upcoming data from the Gaia space observatory, the scientists said. Gaia is a five-year project from the ESA that aims to survey a billion stars in space, and if the new Gaia mission data — coming out in late April — confirm the team's findings, it "will nail [down] this distance measurement forever," said study lead researcher Tom Brown at STScl.

The team calculated the distance to the cluster using a phenomenon called parallax, or the way an object appears to shift slightly in position because of a change in the observer's point of view. The Hubble Space Telescope measured the way the globular cluster seemed to wobble throughout the year due to parallax as Earth traveled around the sun. Hubble's Wide Field Camera 3 observed the parallax of 40 pulsating stars in the stellar cluster every six months for two years. And using a technique called spatial scanning, the astronomers combined the data on all those 40 points to calculate the precise distance of NGC 6397.

The wobbles of the stars represented only 1/100th of a pixel on the telescope's camera, and Hubble measured them to within 1/3,000th of a pixel. STScI representatives framed this result as "the equivalent to measuring the size of an automobile tire on the moon to a precision of 1 inch."

The astronomers calculated the age of the ancient stellar swarm to be 13.4 billion years old. NGC 6397 and globular clusters like it "are so old that if their ages and distances deduced from models are off by a little bit, they seem to be older than the age of the universe," said Brown.

The team's findings appeared in a study published on March 20 in The Astrophysical Journal Letters.

Follow Doris Elin Salazar on Twitter@salazar_elin. Follow us @Spacedotcom, Facebook and Google+. Original article on Space.com.