Work is due to start this week on installing solar panels at a ruined 14th Century castle in Midlothian.
The solar panel project is the first of its kind
It will be the first of government agency Historic Scotland's properties to be fitted with such equipment.
The castle concerned is at Crichton, south-east of Dalkeith. Crichton Castle is noted for its role in Sir Walter Scott's book Marmion.
The hero of the novel is the fictional owner of the building, which was built in the 1300s.
It was extended in subsequent centuries and is renowned for the quality of much of its stonework.
Officials are putting in solar panels to provide power for heating, lighting and other equipment.
They will be sited discreetly, they say, and free of noise and emissions unlike the diesel generator which will be replaced by the panels.