Scientists have unlocked the mystery behind the identity of an ancient, tiny worm. Pictured: A picture taken through a microscope shows a marine worm and grains of sand on June 8, 2017 at the Aquastream company in Ploemeur, western France. Getty Images/Loic Venance

Scientists were baffled by a 505-million-year-old microscopic worm with a body that comprised parts belonging to different worm families, but it seems they may have finally found where this creature belongs on the tree of life.

Aside from its mismatched head and body, the tiny, ancient worm also had hidden jaws that had gone undetected for over 100 years until it was recently discovered by researchers. According to a new study published online Feb. 21 in the journal Current Biology, scientists reported that the discovery of the set of hidden jaws had led them to unlock the mystery behind its identity and finally allowed them to classify the creature that lived hundreds of millions of years ago, long before dinosaurs roamed the Earth.

The creature is classified as Amiskwia sagittiformis, which had an elongated, flat and soft body that had a length of less than 2 inches (5 centimeters). It also had a rounded head with two sensory tentacles, flaps protruding along its sides and a paddle-like tail.

According to the Royal Ontario Museum in Canada, the worm's genus name, Amiskwia, is derived from the Cree word "beavertail." Meanwhile, sagittiformis describes the worm's overall body as the word means "arrow shape" in Latin.

First described in 1911, Amiskwia had scientists wondering where exactly this tiny worm belonged to as it shared features with several other worms. They debated for decades over whether to group Amiskwia under arrow worms, ribbon worms or a separate family altogether.

The study's lead author Jakob Vinther, a senior lecturer with the School of Earth Sciences at the University of Bristol in the United Kingdom, told Live Science that while Amiskwia has a resemblance to its cousins in the arrow worm family, it didn't actually have their distinctive structures, such as spines near the head that are used for catching and holding on to prey.

Amiskwia also didn't have the common, distinctive features of swimming ribbon worms despite sharing a resemblance with them.

However, after using a new technique to examine the worm fossils, scientists discovered that Amiskwia actually had jaws, a feature currently found in worms known as gnathiferans. Researchers coated Amiskwia with ammonium chloride that highlighted its internal structures, and the chemical allowed them to see the "distinct robust elements in its head."

"It looked like a pair of jaws to me, and no other person had seen that before," he said.

Vinther explained that the discovery of Amiskwia having a body similar to an arrow worm and jaws like a gnathiferan led researchers to believe that arrow worms and gnathiferans are more closely related than previously believed. It is possible that the grasping spines of arrow worms today may have evolved from Amiskwia's jaws, which likely helped the ancient creature eat zooplankton and small crustaceans.

Amiskwia lived alongside many bizarre-looking creatures during the Cambrian period, about 543 million to 490 million years ago. Some of the strange, ancient animals that trace its origins back to that time period include the many-limbed, worm-like creature known as lobopod, an eyeless worm that looked like a kitchen brush and a "smiling worm" that seemed to have come straight from a nightmare.

However, like Amiskwia, Vinther said that these ancient creatures weren't all that different from their modern-day descendants.