Over the course of 22 minutes, Hubble took 13 separate exposures, allowing astronomers to create a time-lapse video showing the diminutive moon's orbital path.

The Hubble observations were intended to photograph Mars, and the moon's cameo appearance was a bonus, NASA said in a statement.

Phobos is just 16.5 miles by 13.5 miles by 11 miles.

The little moon completes an orbit in just seven hours and 39 minutes, which is faster than Mars rotates.

Rising in the Martian west, it runs three laps around the Red Planet in the course of one Martian day, which is about 24 hours and 40 minutes.

Phobos was discovered by astronomer Asaph Hall on August 17, 1877 at the US Naval Observatory in Washington, D.C., six days after he found the smaller, outer moon, named Deimos.

Both moons are named after the sons of Ares, the Greek god of war, who was known as Mars in Roman mythology.

Scientists predict that within 30 to 50 million years, it either will crash into the Red Planet or be torn to pieces and scattered as a ring around Mars.

Hubble took the images of Phobos orbiting the Red Planet on May 12, 2016, when Mars was 50 million miles from Earth.

NASA's Goddard Space Flight Centre in Greenbelt, Maryland, manages Hubble.