It might be best known for its otter and puffins, but 170m ago it was home to an enormous flying reptile with a wingspan bigger than a kingsize bed.

Fossil hunters in Scotland say they have recovered the remains of the world's largest pterosaur, which boasted a mouthful of sharp teeth for spearing and trapping fish.

The creature sheds new light on the evolution of pterosaurs, given they were not thought to have reached such a size.

Prof Steve Brusatte, a co-author of the research from the University of Edinburgh, said that it was the largest animal that had ever flown.

He said that we dragged back in time the evolution of large pterosaurs.

Pterosaurs did not grow much larger than about 1.6- 1.8m in wingspan, only reaching much larger sizes during the Cretaceous period, according to previous finds.

The mass extinction 66m years ago that wiped out non-avian dinosaurs was caused by an asteroid that was the size of fighter jets.

Competition with birds may have initially driven the boom in pterosaur size.

According to Brusatte, birds evolved from dinosaurs around the time when this pterosaur was alive.

65 million years ago the impact of an asteroid with the Earth wiped out the dinosaurs, pterosaurs and many other species.

65 million years ago the impact of an asteroid with the Earth wiped out the dinosaurs, pterosaurs and many other species. Photograph: Mark Garlick/SCIENCE PHOTO LIBRARY/Getty Images/Science Photo Library RF

Mary Anning unearthed a flying dragon in the UK in the 19th century.

The completeness of the fossil is notable for the new discovery, dubbed Dearc sgiathanach.

He said that the walls of many of the bones are not very thick, which makes them very difficult to fossilise.

An analysis of the bones showed the animal was a teenager and could have been more than three metres tall.

The team built a digital model of the brain using scans of the pterosaur's skull. The results show that the animal had large eyes.

The fossils were discovered by a PhD student who spotted the creature's skull during fieldwork on the Isle of Skye.

She told the Guardian that it didn't look like anything else she'd seen.

Jurassic pterosaur fossil.

Jurassic pterosaur fossil. Photograph: Kevin Schafer/Getty Images

I grew up going to the Natural History Museum in London and reading about Mary Anning's discoveries, which definitely influenced my decision to become a palaeontologist.

Dr David Unwin, an expert in pterosaurs at the University ofLeicester who was not involved in the research, said it was not certain if the new creature was the largest of its era.

He said the find was significant because there are very few complete pterosaur remains.

He said that the new find will allow them to go back to the older collections and better understand what they have in there.