Trilobites are perhaps the most successful group of animals ever to live. Named for their distinctive three-lobed body, these armored, pill-bug-like arthropods were some of the first hard-bodied animals on Earth. They appeared some 520 million years ago and dominated the fossil record of ancient seas for nearly 300 million years afterward. To date, paleontologists have uncovered a staggering 20,000 species, sporting every outlandish configuration of plates, spines and horns imaginable. “It’s just like, ‘Evolution, go home; you’re drunk,’” says Russell Bicknell, a paleobiologist at the University of New England in Australia.

Yet despite their abundance, nobody has been able to figure out how trilobites reproduced—until now. In a very unusual fossil, scientists have found one of the first examples of sexual anatomy in the fossil record: a small pair of grasping appendages that let the male trilobite hold the female close during mating.

Reproduction in extinct animals is notoriously difficult to study, especially when it comes to invertebrates. “Understanding reproductive behavior is difficult because it doesn’t preserve easily,” says Harvard University paleontologist Sarah Losso, one of the co-authors of the recent study, which was published in Geology. Trilobites’ delicate bits, such as legs, antennae and reproductive structures, were made of soft tissues that rarely petrified. Paleontologists can infer the existence of legs based on sockets in some species’ outer shells and trace impressions. But reproductive organs were frustratingly elusive.

Another reason boils down to scientific bias. In the past, some researchers assumed trilobite reproduction would be similar to mammalian reproductive strategies, leading them to search for structures such as a “trilobite penis” (which has yet to be found). “That’s inappropriate,” says Thomas Hegna, an invertebrate paleontologist at the State University of New York at Fredonia, who was not involved in the new research.

All that changed when Losso and her colleagues took a closer look at a 508-million-year-old trilobite fossil from the famous Burgess Shale deposit in British Columbia. The species, Olenoides serratus, is about as well-known as ancient arthropods get: it makes up many of the Burgess Shale’s fossils and the genus even lends its name to a Yu-Gi-Oh fantasy game card.

Losso’s specimen was in an unusual position, however. It fossilized lying on its side rather than on its back or belly like most Olenoides fossils. What’s more, its appendages were stretched out and preserved in remarkable detail, down to the joints. Among them, researchers found two sets of short, grasping appendages that looked an awful lot like reproductive structures called claspers.

A fairly common reproductive feature in marine species, claspers allow male animals to hold on to their mate as they release sperm underwater. Claspers can be found in shrimp, aquatic insects and even sharks—and, crucially, trilobites’ modern analogues, horseshoe crabs.

Horseshoe crabs and trilobites are not closely related. But scientists think that the ancient arthropods occupied a niche very similar to what their modern counterparts do, scooting along sandy ocean bottoms like aquatic Roombas and feasting on morsels that drift to the seafloor. “In fact, there were certain trilobite species that basically look exactly like a horseshoe crab,” says Bicknell, who was not involved in the study. For this reason, horseshoe crabs are often used as a template for modeling trilobites’ life cycle and behavior.

The looks of claspers in horseshoe crabs helped Losso and her team verify that the Olenoides appendages were more than just malformed feet. Claspers suggest that, in some species, male and female trilobites had different looking bodies. “They have found that Rosetta stone fossil that allows us to really confirm these theories about sexual dimorphism,” Bicknell says. “This is just a really nice, fundamentally important addition.”

Losso cautions that the feature might not be universal. “Finding claspers in Olenoides serratus doesn’t mean that all trilobites reproduced that way,” she says. Nevertheless, the study marks an important milestone in trilobite paleontology, one which will help inform future research. It hints the animals evolved a wider variety of specialized limbs than previously thought and did so early in their evolutionary history. “It speaks to a really cool underlying modularity,” Hegna says. “They’re an armored Swiss Army knife.”