The Cuillin mountains were put up for sale in a bid to pay for repairs
A historic castle at the centre of a bid to sell mountains to raise funds needed to repair it has secured a £594,188 government grant.
Dunvegan Castle on Skye has been the MacLeod clan seat for 800 years.
The late chief John MacLeod of MacLeod put the island's Cuillin mountains up for sale in the hope of raising enough money to repair its leaking roof.
The Scottish Government said the Historic Scotland grant would pay for a three-year programme of works.
Culture Minister Linda Fabiani announced the award in the latest round of Historic Scotland building repair grants, totalling £1.6m.
It opens the way for repairs and a renewal of the lead roof coverings and guttering to prevent further water damage.
Ms Fabiani said: "Dunvegan Castle is one of the most recognised and historic castles in Scotland - both at home and abroad.
"It has been an important seat of political and cultural power throughout its history and it is fitting that, as we move closer to the Year of Homecoming, we invest in its future to celebrate its past."
Hugh MacLeod of MacLeod Estate said Dunvegan was an iconic building.
He added: "It is a key driver of economic growth on the Isle of Skye, acting as a magnet for over one hundred thousand visitors every year.
"Although this is the first stage of a long process that will take many years to accomplish, I am very grateful to Historic Scotland for supporting my aim of securing this vital historic asset for future generations to enjoy."
His father, John MacLeod, died at the age of 71 in 2007.
The 29th chief of the Clan MacLeod, who succeeded his grandmother Dame Flora as chief in 1976, died in London after a battle against leukaemia.
DUNVEGAN IN NUMBERS
800-year-old seat of Clan MacLeod
£19m estimated cost it would cost in 2007 to carry out repairs
£25m lottery application by the MacLeods to restore and develop the castle and its grounds
The late Mr MacLeod caused controversy when he put the Black Cuillin range in Skye up for sale to pay for repairs to Dunvegan Castle.
When he failed to find a buyer, he proposed transferring the mountains to public ownership under a plan which would have seen the castle transferred to a charitable trust.
However, Highlands and Islands Enterprise said it could not afford the cost of refurbishing the castle, estimated at up to £19m.
In 2006, a £25m application was made to the National Lottery for a grant to restore the castle, tidy up the grounds and develop the existing visitor centre.
It was understood that Mr MacLeod would have given up ownership of both Dunvegan Castle and the mountains if the bid was successful.
But it later emerged that the application had been rejected.