A pair of 99-million-year-old cockroaches are rewriting the early history of the underworld.

The ancient roaches, found preserved in amber in Myanmar, are the oldest-known examples of "troglomorphic" organisms — creatures that adapted to the weird, dark environments of caves. And they're the only such dark-adapted creatures known from the Cretaceous period, having scurried around in the world's shaded crevices even as Tyrannosaurus rex walked the Earth. Nowadays, biologists have plenty of examples of cockroaches and of cave-dwelling insects with small eyes and wings, pale bodies, and long arms and antennae. But these specimens, from two distinct, related species, are the oldest animals ever found with those traits.

Related: Photos: Cretaceous 'graveyard' holds a snapshot of the dino-killing asteroid impact

"Caves lack unequivocal fossils before the Cenozoic," the researchers wrote in a paper describing their find, referring to a later period after the mass extinction (known as the K/Pg boundary) when dinosaurs died and mammals rose to their current prominence.

And even cave fossils from after the extinction tend to be of animals that spent only some of their time in caves, using them as shelters in between excursions into the sunlit world.

"Cave environments are well suited for fossilization of bones and coprolites [or fossilized feces] and the fossil record of cave mammals includes rodents, ungulates, marsupials, ursids, felids, hyaenids, canids, primates and humans," they wrote — all species with plenty of bones and poop. They added that "there is no relevant fossil record of any troglomorphic fauna before K/Pg with the exception of the present find."

Until now, the history of cave-dwelling cockroaches was known to go back to the Cenozoic era, which began about 65 million years ago. But researchers had long suspected that cave-dwelling roaches might date back to the dinosaur age, the researchers wrote, based on genetic analyses. But there had never before been firm evidence.

These two "exquisitely preserved" species, they said, according to a news article on Phys.org, were likely descendants of a common ancestor from earlier in the Cretaceous, before continental drift separated their homes on the supercontinent Gondwana.

It's not clear, the researchers noted, how the roaches ended up so well preserved. Amber fossils are common for small creatures that live near trees, because amber is fossilized tree resin. It's possible, the researchers suggested, that ancient resin dripped from tree roots into the cockroaches' caves and then hardened around the paleo-arthropods.

The study researchers, hailing from several institutions in Slovakia, China, Russia and Thailand, detailed their discovery online Feb. 11 in the journal Gondwana Research.

Originally published on Live Science.