It's being called the world's oldest public toilet.

Researchers announced in a study this week the discovery of a prehistoric communal latrine filled with thousands of pieces of fossilized animal poop.

Unearthed in Argentina, the latrine was used about 240 million years ago by Dinodontosaurus, a megaherbivore that LiveScience likened to a cross between a rhinoceros and the demon dogs from "Ghostbusters."

(Story continues below)

dinosDinodontosaurus turpior, a big dicynodont or mammal-like reptile from Middle Triassic of South America and (possibly) Germany.

Communal latrines are areas where animals return repeatedly to poop, creating dung heaps. While such sites have been linked to mammals, this is the first time scientists have found evidence of communal latrines used by non-mammal vertebrates.

The team discovered the prehistoric poop two years ago while digging in northwestern Argentina, LiveScience reported. In total, eight separate latrine areas were discovered, some holding as many as 94 fossil poops for every 10 square feet. Some pieces of fossilized feces -- which scientists call coprolites -- measured a foot in diameter. What poop!

Why the common pooping area? A communal latrine can serve as a way to mark territory, and it can help prevent the spread of parasites.

"Firstly, it was important to avoid parasites -- 'you don't poo where you eat,' as the saying goes," researcher Dr. Lucas Fiorelli, of the Centro Regional de Investigaciones Científicas y Transferencia Tecnológica, told the BBC. "But it's also a warning to predators. If you leave a huge pile, you are saying: 'Hey! We are a big herd. Watch out!'"

Fiorelli plans to continue investigating the dig site, as well as the dung, according to LiveScience. The poop alone may give researchers an idea of what kind of plants lived in the area 240 million years ago.

The study was published online in Scientific Reports on Nov. 28, 2013.

Also on HuffPost:

Loading Slideshow...
  • Titanis walleri

    This North American bird, which stood over 8 feet tall, would have had an enormous, axe-like beak.

  • Dunkleosteus terreli

    This heavily-armored predator had the second most powerful bite of any fish.

  • Indricotherium

    The hornless rhinoceros-like creatures of this genus were the largest land mammals of all time.

  • Megatherium

    Giant ground sloths of this genus were about the size of today's elephants. The megatherium only went extinct around 10,000 years ago (right around the time when humans started farming), and smaller relatives may have survived as late as the 16th century!

  • Dinornis novaezealandiae

    Richard Owen, director of London's Museum of Natural History, stands next to the largest of all moa. Moa, which originated in New Zealand, were flightless, and some were even wingless.

  • Argentavis magnificens

    The Argentavis magnificens, an early relative of the Andean Condor, was the largest flying bird ever discovered.

  • Diprotodon optatum

    These creatures, the largest marsupials that ever lived, roamed Australia. Some scientists have suggested that stories of the supernatural 'bunyip' creature in Aboriginal folklore could be based on diprotodonts.

  • Deinotherium giganteum

    These distant relatives of modern elephants had an imposing appearance, with strange, downward-curving tusks and heights of up to 16 feet at the shoulder.

  • Leedsichthys problematicus & Liopleurodon rossicus

    The fearsome Liopleuredon, right, had a jaw nearly ten feet long. The Leedsichthys, left, was a bony fish that may have been even larger than it looked; some estimates put its maximum length at 53 feet. <strong>Correction</strong>: <em>An earlier version of this slide had the positions of the Liopleuredon and Leedsichthys reversed</em>.