A growing crisis in Scottish livestock farming is threatening to reverse a "remarkable" recovery in numbers of a rare bird, experts have warned.
The corncrake had been heading for extinction in the UK
The corncrake population is at its highest level in almost three decades, numbering about 1,270 calling males.
But RSPB Scotland has issued a warning over the loss of cattle farming in some areas of north and west Scotland.
It said this was depriving corncrakes and other wildlife of the food resources and habitats they needed.
The corncrake has seriously declined throughout most of western Europe, but figures from RSPB Scotland's 2007 survey found 1,273 calling males north of the border.
The inner Hebridean and Argyll islands have proved particularly attractive breeding grounds for the rare and shy bird, which likes field margins and hay meadows.
Corncrakes migrate to Scotland in April and May, mainly around the islands of Tiree, Coll, Iona, Mull, Oronsay, Colonsay and Islay.
They come from sub-Saharan Africa, where they spend the winter.
When the corncrake recovery programme began in 1993, as a partnership between crofters and RSPB Scotland, there were only 470 calling males recorded for the whole of the UK, with the species heading towards national extinction.
Farmers and crofters in key corncrake areas have been encouraged to undertake management to reverse the downward spiral, but RSPB Scotland said changes to agricultural support systems and a growing crisis in Scottish livestock farming was a serious threat.
The organisation said environmentally fragile, peripheral areas in north and west Scotland - in particular some of the islands - had already seen some loss of cattle farming as it has become more economically marginal and in some cases unviable.
The number of cattle farmed in Scotland has dropped by about 200,000 in the past 10 years, to a national herd of just under two million.
Stuart Housden, director of RSPB Scotland, said: "The corncrake and many other important species are very much dependent on extensive cattle rearing practices that characterise much of the Highlands and Islands.
"This type of farming has become ever more economically marginal because of changes in agricultural support systems.
"If we are to see this wildlife flourish, funding streams like the Less Favoured Areas Support Scheme and Rural Stewardship Scheme must be both retained and targeted to ensure that these extensive farming systems continue to produce benefits for the rich array of species and biodiversity found here."
Flora MacLean, who crofts with her husband Lachie on Tiree, said: "This year more birds than ever returned and the croft was alive to the sound of males trying to attract a mate.
"There were also a lot more to be seen, which is a thrilling experience because they are normally so elusive."