"So you see lots of red squirrels and you see them coming back into areas where they hadn't been for quite some time."

Woodland forensics

To work this out, the team carried out what Dr Sheehy described as "forest CSI". She and her colleagues attached sticky pads to the undersides of baited feeder boxes.

"All three species use these boxes and when an animal lifts the lid with its head, it leaves us a little hair sample for our analysis," Dr Sheehy said.

With DNA from those hair samples and images from motion-activated cameras confirming which animals were visiting the feeders, the scientists were able to assess each species' population and activity levels.

Pine martens – cat-sized members of the weasel family – are gradually becoming re-established in parts of Scotland, after their near extinction in the UK.

They used to be trapped in large numbers by game-keepers, and also hunted for their fur, which was a valuable export from Scotland.

It is has been illegal to hunt the animals since the 1980s, and their numbers are now increasing. In recent years, evidence has emerged that they are also crossing the border and becoming established in Northumberland. A small population of the mammals was also relocated in 2015 from Scotland to Wales.

This evidence – that their comeback has given a boost to red squirrel survival – could indicate that they are able to catch and eat the non-native greys more easily.

"Red squirrels co-evolved with pine martens," explained Dr Sheehy. "They've managed to co-exist over such a long time and their population doesn't seem to be affected by losing the odd individual to a predator."

Grey squirrels on the other hand were introduced from the eastern coast of North America, where there are no pine martens.

"They aren't used to living with a predator so adept at climbing trees, and they spend a lot more time on the ground. So, theoretically, they are much more susceptible," Dr Sheehy told BBC News.

"We have the case of the recovery of one very rare protected species actually helping the recovery of another species, for which we didn't know what the future held.