Fossils from the early Cambrian period suggest that phallus-shaped worms were once a fright of the ancient oceans, widely scattered over the globe and equipped with extendible, fang-lined lips capable of gobbling any unlucky marine creature that crossed their path.

The Cambrian period (543 million to 490 million years ago) saw the first big boom of biodiversity on Earth, with the ancestors of almost all modern animals appearing for the first time. The penis worm was one of the most feared among them.

Also known as priapulids and named after Priapus, the well-endowed Greek god of male genitals, penis worms are a division of marine worms that have persisted in the world's oceans for 500 million years. Their current descendants reside in muddy burrows deep underwater, where their floppy, phallus-shaped bodies occasionally frighten fisherman.

Some species are extremely resistant to hydrogen sulfide and anoxia, and they can be quite abundant in specific areas.

Penis worms, as terrifying as they were, were not without dread. Researchers uncovered four priapulid fossils nestled between the cone-shaped shells of hyoliths, a long-extinct group of marine organisms, in a new study published Nov. 7 in the journal Current Biology.

Because all of the worms were discovered in the same sort of shell and in about the same place, the researchers believe the worms had adopted the shells as their homes, similar to how current hermit crabs do.If that's the case, phallus-shaped worms may have invented the "hermit" lifestyle hundreds of millions of years before the crustaceans who popularized it.

"The only explanation that made sense was that these shells were their homes - something that came as a real surprise," study co-author Martin Smith, an associate professor of paleontology at Durham University in England, said in a statement.

The researchers claimed that this form of "hermiting" behavior has never been documented in priapulids or any other species until the Mesozoic era (250 million to 65 million years ago).

Smith finds it "mind-boggling" that such complex behavior could have arisen so quickly after the Cambrian explosion. Even ferocious penis worms had to get creative in the harsh conditions of the early seas.