NASA's Cassini spacecraft captured this view of the Janus 2:1 spiral density wave in Saturn's rings on June 4, 2017.

NASA's Cassini spacecraft has captured a spectacular photo of a perplexing wave structure in one of Saturn's rings as the probe heads into its final days at the gas giant.

The rings of Saturn are embedded with billions of water-ice particles ranging in size from grains of sand to monstrous chunks. Saturn's rings also feature waves that propagate outward in spiral patterns.

The new image from Cassini captures an up-close view of a spiral density wave visible in Saturn's B ring. The wave structure is a buildup of material that has formed from the gravitational pull of Saturn's moons, NASA officials said. [Fly Through Space Photos 'In Saturn's Rings' (Video)]

The density wave visible in Saturn's B ring originates 59,796 miles (96,233 kilometers) from the planet, where the "ring particles orbit Saturn twice for every time the moon Janus orbits once, creating an orbital resonance," according to a statement from NASA.

In the new image, the wave structure — aptly named the Janus 2:1 spiral density wave — appears to ricochet outward, away from Saturn and toward the upper-left corner of the photo, creating hundreds of bright wave crests.

The density wave is generated by the gravitational pull of Saturn's moon Janus. However, Janus and one of Saturn's other moons, Epimetheus, share practically the same orbit and swap places every four years, creating a new crest in the wave, according to the statement.

As a result, the distance between any pair of crests corresponds to four years' worth of wave oscillations. This pattern represents the orbital history of Janus and Epimetheus, much like the rings of a tree reveal information about its growth.

Based on this idea, the crests of the wave at the very upper left of the new Cassini image correspond to the positions of Janus and Epimetheus during the Saturn flybys of NASA's twin Voyager probes in 1980 and 1981, according to the statement.

The recent images of Saturn's B ring were taken on June 4, 2017, using Cassini's narrow-angle camera. After 20 historic years in space, the Cassini mission will come to a close on Sept. 15, when the spacecraft will intentionally dive into Saturn's atmosphere.

Follow Samantha Mathewson @Sam_Ashley13. Follow us @Spacedotcom, Facebook and Google+. Original article on Space.com.