T.Rex's ancestors lived on the Isle of Skye 167 million years ago

It's best known for its rugged landscapes, picturesque fishing villages and medieval castles.

But the Isle of Skye used to be a social hotspot for dinosaurs – including Tyrannosaurus rex's ancestors – according to a new study.

Experts have discovered massive meat-eating and plant-eating dinosaurs drank together from the island's shallow freshwater lagoons 167 million years ago.

The tracks include rarely-seen footprints of carnivorous megalosaurs - cousins and ancestors of T.Rex - alongside those of herbivorous sauropods. 

Researchers said the large, circular impressions made by the latter point to a long-necked dinosaur two or three times the size of an elephant, while the megalosaur would have been 'jeep-sized'.

The team said the site provides a 'fascinating insight' into the environmental preferences and behaviours of dinosaurs from the Middle Jurassic period.

Analysis of the multi-directional tracks and walking gaits, they explained, suggest the prehistoric beasts milled around the lagoon's margins, similar to how animals congregate around watering holes today.

An artist's impression of the meat-eating and plant-eating dinosaurs mingling at the site on the Isle of Skye

A pair of megalosaur footsteps seen at the site. These dinosaurs were the older 'cousins' and ancestors of the famous T.Rex

They added that the tracks show that regardless of dominance, the meat-eating therapods and plant-eating sauropods habitually spent time in lagoons, as opposed to exposed, drier mudflats.

Research lead Tone Blakesley said: 'The footprints at Prince Charles's Point provide a fascinating insight into the behaviours and environmental distributions of meat-eating theropods and plant-eating, long-necked sauropods during an important time in their evolution.

'On Skye, these dinosaurs clearly preferred shallowly submerged lagoonal environments over subaerially exposed mudflats.'

The first three footprints at the site were discovered five years ago by a University of Edinburgh student and colleagues during a visit to the shoreline.

Subsequent discoveries of other footprints in the area made it one of the most extensive dinosaur track sites in Scotland, with scientists saying they expect to find more.

The research team studied the tracks by taking thousands of overlapping photographs of the entire site with a drone, before using specialist software to construct 3D models of the footprints via a technique called photogrammetry.

Steve Brusatte, personal chair of palaeontology and evolution at the University of Edinburgh, reflected on the fact the remote bay on the Trotternish Peninsula was also where Bonnie Prince Charlie hid in 1746 while on the run from British troops.

'Prince Charles's Point is a place where Scottish history and prehistory blend together,' he said.

Researchers said the large, circular impressions made by the latter point to a long-necked dinosaur two or three times the size of an elephant.

The Isle of Skye, connected to Scotland's northwest coast by bridge, is known for its rugged landscapes, picturesque fishing villages and medieval castles

The terrifying T.Rex is widely regarded as the most famous dinosaur. This is partly because it was the first very large carnivorous dinosaur to be discovered and it was long believed to have been the largest that ever lived (stock image)

'It's astounding to think that when Bonnie Prince Charlie was running for his life, he might have been sprinting in the footsteps of dinosaurs.'

The research, published in PLOS One, was funded by the Leverhulme Trust and National Geographic Society.

Last year, scientists discovered a new species of pterosaur on the Isle of Skye in Scotland.

Named Ceoptera evansae, the winged reptile lived between 168 to 166 million years ago during the Middle Jurassic period.

Palaeontologists spotted the fossil remains in 2006 during a field trip to Elgol, on the south-west coast of the island.

Since then, the team have spent years physically preparing the specimen and taking scans of the bones, some of which remain completely embedded in rock.

Despite the skeleton being incomplete – with only parts of the shoulders, wings, legs and backbone remaining – the researchers said it provides key insights into the evolutionary history and diversity of pterosaurs.