Dinosaurs living more than 200 million years ago had some serious competition from an ancestor of modern mammals the size of an elephant.
Fossil bones discovered in Poland belonged to a huge toothless plant-eater that stood on four legs and weighed nine tons.
Scientists have identified it as a dicynodont, a reptile with mammalian traits, that co-existed with the dinosaurs before they came to dominate the Earth.
Other known dicynodonts have ranged in size from rat-like burrowers to browsers as big as cows.
The newly identified species, named Lisowicia bojani, has overturned the idea that dinosaurs were the only really large land animals around during the Triassic period.
Despite their reptilian heritage dicynodonts and their relatives were the ancestors of all modern mammals, including humans.
Dr Tomasz Sulej, one of the researchers from the Polish Academy of Sciences, said: “The discovery of Lisowicia changes our ideas about the latest history of dicynodonts, mammal Triassic relatives.
“It also raises far more questions about what really makes them and dinosaurs so large.”
Colleague Dr Grzegorz Niedzwiedzki, from Uppsala University in Sweden, said: “Lisowicia is hugely exciting because it blows holes in many of our classic ideas of Triassic ‘mammal-like reptiles’.”
The fossils were found in the Polish village of Lisowice, which gave the creature its genus name.
A study of the bones, published in the journal Science, shows that Lisowicia was about 4.5 metres (14.7ft) long and 2.6 metres (8.5ft) high – roughly the size of a modern elephant.
It was 40% larger than any dicynodont identified before.
Unlike many of its relatives, which sprawled like lizards, Lisowicia stood upright in a similar way to large present-day mammals such as rhinos and hippos.
Dr Niedzwiedz added: “Dicynodonts were amazingly successful animals in the Middle and Late Triassic.
“Lisowicia is the youngest dicynodont and the largest non-dinosaurian terrestrial tetrapod (four-legged animal) from the Triassic. It’s natural to want to know how dicynodonts became so large.”
The fossils are the first to reveal that large dycynodonts were alive at the same time as early long-necked sauropod dinosaurs.
During this period, between 210 and 205 million years ago, dinosaurs were not yet the super-giants some of them were to become.
One of the earliest big dinosaurs, a sauropod from what is now Argentina called Ingentia prima, only weighed about 10 tons and was not much heavier than Lisowicia.
Later sauropods, such as diplodocus and brachiosaurus, included the largest land animals that ever lived.
Dicynodonts are all thought to have died out before dinosaurs reached the pinnacle of their 200 million year reign.
They belonged to a bigger diverse group of mammal-like reptiles called therapsids, which included both plant and meat-eaters.
Therapsids are thought to have had naked skin rather than scales like reptiles and were probably warm-blooded.