The pine marten has emerged as an unlikely ally for the beleaguered native red squirrel in its battle with the grey squirrel.
This is according to scientists at the University of Aberdeen, who carried out an in-depth forensic study of the relationship between the three species.
The pine marten is a predator of the reds, but in areas where it thrives, the number of grey squirrels reduces.
The findings are published in Proceedings of the Royal Society B.
The journal study suggests that the pine martens reverse the "typical relationship" between red and grey squirrels, where the red always loses out, according to lead researcher Dr Emma Sheehy.
"Where pine marten activity is high, grey squirrel populations are actually heavily suppressed. And that gives the competitive advantage to red squirrels," she said.
"So you see lots of red squirrels and you see them coming back into areas where they hadn't been for quite some time."
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.