The Scottish Government's decision to grant consent for a 67-turbine wind farm was lawful, judges have ruled.
Scottish ministers and SSE have won an appeal against an earlier ruling that the approval of Stronelairg wind farm in the Highlands was "defective".
The John Muir Trust opposed the granting of consent in June 2014 for SSE's development, located south-east of Fort Augustus in the Great Glen.
The conservation charity launched a legal challenge on the basis it would have an unacceptable impact on wild land.
The charity's petition for judicial review was successful in overturning consent in December last year, but that judgment was appealed by the Scottish Government and SSE during a hearing before three judges at the Inner House of the Court of Session in Edinburgh in May.
In the latest decision, Lord Carloway concluded the granting of consent for Stronelairg was lawful.
Stuart Brooks, chief executive of the John Muir Trust, said the charity was "disappointed" by the decision.
He said: "We took out this legal action reluctantly because of the sheer scale of the development proposed by SSE in an area of wild land, the potential ecological damage to a vast area of peatland and the breadth of opposition - which included Scottish Natural Heritage, the Cairngorms National Park Authority, the Mountaineering Council of Scotland and three out of four local councillors.
"Lord Jones, in the initial judicial review, found in favour of the trust's legal arguments that the Scottish Government had not followed the correct planning process.
"The Inner House judges have disagreed with that assessment. We are now taking further legal advice and considering options."
Welcoming the ruling, energy minister Paul Wheelhouse said: " This project will create jobs and generate important economic benefits for the Highlands and Islands economy.
"The wind farm is designed to produce electricity equivalent to the needs of more than 100,000 homes - a vital boost at a time where Scotland, the UK and Europe all need to ensure a secure energy supply for the future.
"It will also produce a further boost to Scotland's work in leading international efforts to reduce greenhouse gas emissions."
A spokeswoman for SSE said: "We welcome the ruling of the Court of Session on the appeal of the Stronelairg judicial review.
"Stronelairg is a carefully-designed project with the carbon payback estimated to be around 16 months.
"It was strongly supported by many local stakeholders, was not opposed by the local community council and was supported by the Highland Council planning committee."