Kisimul Castle, Barra, is one of the most important surviving symbols of Gaelic Scotland, but now needs to be conserved and developed to play a 21st century role for the island.
Sitting on a rock in the main bay, it was the Clan Seat of the Macneils, or MacNeils, of Barra who claimed descent from the legendary Niall Of The Nine Hostages, high king of Ireland in the fifth century and great-grandfather of St Columba.
Their modern day descendants worldwide have donated about £100,000 to help pay for major conservation, archaeological and interpretation work as part of a plan agreed between Historic Scotland and the 46th Macneil clan chief.
The work will see an investment of more than £200,000 in total. As part of the plan, three key projects will be completed by the end of 2015 - re-roofing the flat roof over the hall; reinforcing concrete structures and overhauling the chapel roof and incorporating a new timber walkway.
Upgrading works to slipways at the castle and on the shore will follow at a later date.
Historic Scotland has made special efforts to record local knowledge of the source of materials used to build the castle. In this way, it should be easier to more accurately conserve the fabric of the ancient monument.
However, archaeological excavations, commissioned by Historic Scotland this year, have unearthed some interesting items, including possible Iron age pottery, flint cores and animal bone.
As a significant part of this plan, further work has the potential to discover more about the castle's history, how it was used and the history of the earlier occupation of the islet on which the castle sits.
In 2000, responsibility for man-agement and conservation of what is regarded as the most significant medieval castle in the Western Isles was transferred to Historic Scotland on a 999-year lease by Ian Roderick Macneil Of Barra, 46th clan chief.
The American-born law professor, who taught a young Barack Obama, had set the price at £1 and the annual rent of a bottle of Talisker.
The chief died in 2010, but his son Rory Macneil, the 47th Clan Chief and 27th of Barra, who lives between Barra and Edinburgh, said: "Agreement on the conservation plan is a milestone in the long and varied history of Kisimul Castle.
"It opens the door to completion of the immediate projects covered by the plan and long term conservation of this unique structure. This plan will help ensure Kisimul continues to play a central, symbolic and economic role in Barra and Vatersay, and to serve as an inspiration to MacNeils around the world.
"I would like to express my gratitude to clanspeople whose contributions to the restoration fund can now be put to good use, and to Historic Scotland for its stewardship of the castle over the past 13 years and the positive way it is engaging with the Barra and Vatersay community."
About 5000 people a year take the short boat journey to see the castle.
Ian Walford, chief executive of Historic Scotland, said: "There are few castles of this nature in Scotland. For most visitors it is their first experience of Barra's historic environment. This plan will conserve and enhance a truly magical site in a spectacular setting for future generations to come."