Researchers have discovered an ancient relative of dinosaurs, a 4-inch reptile that lived 237 million years ago.

Known as Kongonaphon kely, the ancient reptile was a "tiny bug slayer" and lived in modern-day Madagascar, according to a study published in the journal Proceedings of the National Academy of Sciences. The fossil was first discovered in 1998 by a team of researchers from all over the world, including from the American Museum of Natural History.

“There’s a general perception of dinosaurs as being giants,” said the study's lead author, Christian Kammerer, in a statement. “But this new animal is very close to the divergence of dinosaurs and pterosaurs, and it’s shockingly small.”

Life restoration of Kongonaphon kely, a newly described reptile near the ancestry of dinosaurs and pterosaurs, shown to scale with human hands. The fossils of Kongonaphon were found in Triassic (~237 million years ago) rocks in southwestern Madagascar and demonstrate the existence of remarkably small animals along the dinosaurian stem. (Credit: Frank Ippolito, American Museum of Natural History)

DINOSAURS WERE DEFINITELY KILLED BY ASTEROID AND NOT VOLCANO, NEW STUDY SAYS

With the pointy, albeit worn, teeth, it's likely that Kongonaphon fed on a diet of insects, the researchers stated. They also looked at a part of the reptile's thigh bone to conclude that it was a full-grown creature and not a baby.

John Flynn, who helped discover the fossil in the late 1990s, said he was surprised at the diminutive size of Kongonaphon, but also how unique the discovery was.

“This fossil site in southwestern Madagascar from a poorly known time interval globally has produced some amazing fossils, and this tiny specimen was jumbled in among the hundreds we’ve collected from the site over the years,” Flynn added in the statement.

“It took some time before we could focus on these bones, but once we did, it was clear we had something unique and worth a closer look," Flynn continued. "This is a great case for why field discoveries – combined with modern technology to analyze the fossils recovered – is still so important.”

Body size comparison between the newly discovered Kongonaphon kely (left) and one of the earliest dinosaurs, Herrerasaurus. (Credit: Phylopic.org by Scott Hartman (CC BY 3.0) Frank Ippolito, AMNH)

MASSIVE ASTEROID EXPLOSION THAT KILLED THE DINOSAURS BENEFITED BACTERIA, STUDY SAYS

Project co-leader and study co-author Lovasoa Ranivoharimanana said the find shows how increasingly important Madagascar has become to archaeologists over the years, given the number of ancient fossils found on the African island.

“Discovery of this tiny relative of dinosaurs and pterosaurs emphasizes the importance of Madagascar’s fossil record for improving knowledge of vertebrate history during times that are poorly known in other places,” said Ranivoharimanana, professor and director of the vertebrate paleontology laboratory at the University of Antananarivo in Madagascar.

It's believed that Kongonaphon may have belonged to Ornithodira, a group that includes dinosaurs and birds, but more research is needed to get a better understanding on their evolution.

“Recent discoveries like Kongonaphon have given us a much better understanding of the early evolution of ornithodirans," Kammerer explained. "Analyzing changes in body size throughout archosaur evolution, we found compelling evidence that it decreased sharply early in the history of the dinosaur-pterosaur lineage.”

Experts continue to learn more about the early days of the dinosaurs. A study published last month found that some dinosaurs who faced scarce resources resorted to scavenging and possibly cannibalism.

A study published in March suggested dinosaurs traveled significantly shorter distances and had drastically different migration behavior than initially believed.

GET THE FOX NEWS APP