The three young dinosaurs had snuggled together to sleep when disaster struck. A thick layer of ash or soil, probably from a volcanic eruption or sand storm, poured over them and the animals, each the size of a large dog, died within minutes.

For 70 million years they lay entombed, cradled beside each other within a slab of rock, until US scientists uncovered their remains earlier this year. Subsequent analysis of the fossilised bones – which come from the Gobi desert – reveal the first known example of roosting among dinosaurs.

The discovery, outlined at the recent Society of Vertebrate Palaeontology meeting in Calgary, has caused considerable excitement among scientists because communal roosting – sleeping in groups – is exhibited by many modern species, including crows and bats.

Yet in the middle of the Jurassic Period dinosaurs were already exhibiting such social interactions. Far from being solo, lumbering beasts, as depicted in the past, evidence now indicates they acted in surprisingly sophisticated ways.

This is stressed by Alberta University’s Greg Funston, who led the team that analysed the three fossilised dinosaurs. “The trio had quite a close bond,” he said in the journal Nature. “They were living together at the time of death.”

The dinosaurs in the rock have not yet been named but are described as having domed crests on their heads. They walked on two legs and looked like a cassowary, the giant flightless bird found today in northern Australia and New Guinea.

“This is a spectacular discovery for it shows these were animals that were living together in flocks like birds do today,” said Stephen Brusatte of Edinburgh University. “They probably had feathers, although they could not fly. However, they were undoubtedly social creatures.”

Scientists have now established that birds evolved from a group of dinosaurs that include velociraptors, the deadly socialised killers of Jurassic Park fame. “In addition, it has been shown dinosaurs were warm-blooded unlike other reptiles,” said Professor Mike Benton of Bristol University. “They also had feathers, not to help them fly but to keep them warm and help them display at each other, the equivalent of the male peacock tail that signals a bird’s biological fitness to potential mates – a crucial ability for a social animal. It was only later in Earth’s history that feathers were used as aids that could help birds become airborne.”

New research has also revealed that some dinosaurs’ feathered coats had stripes, others had patches and some had crests. These elaborate plumage patterns almost certainly played roles in earmarking territory, warning off rivals and attracting mates. Thus the crested species uncovered by Funston and his team very likely browsed for food in groups while males displayed their crests at mates or rivals.

“In groups, they would have benefitted from increased foraging efficiency, decreased threats from predators, and increased chance of mating,” Funston told the Observer.

Some researchers say the bones could have been compressed by a flood or subsidence long after the animals’ deaths. But Funston’s analysis shows that two of the animals were crouched belly down with their necks curled back towards their bodies, while their forelimbs cradled their heads: a pose similar to those of sleeping ostriches and emus.

It is also likely the three animals were siblings, a point put forward by David Varricchio of Montana State University. “Juvenile ravens and seagulls stick together to begin with when they leave their parents’ nests and this could well have been a similar group of siblings who were huddling together when they were struck down.”

Intriguingly, Funston’s discovery might not have been made but for the alertness of Mongolian customs agents who seized the stone as it was being illegally exported in 2006. “Despite having an incredible fossil to show, we have lost much of the information about the circumstances of their death and preservation because the fossils were poached,” said Funston. “That is what happens with fossil-poaching.”