A judge has thrown out a legal challenge against plans for a second wind farm at Clashindarroch in Aberdeenshire.
Minsters approved Swedish energy giant Vattenfall's Clashindarroch II project in June last year.
But conservation group Wildcat Haven took the case to the Court of Session over concerns for the local wildcat population.
It claimed the Scottish government had acted unlawfully.
The group said the new 14-turbine development would be "potentially catastrophic" for the elusive species as wildcats were known to avoid wind farms due to the noise and human activity.
Its lawyers argued that Scottish ministers failed to follow correct legal tests.
However, in a written judgement issued by the court, judge Lord Sandison concluded that the evidence available in the case showed that ministers did act within the law.
He wrote: "It is clear that many interested individuals, as well as the petitioners, entertain reasonable and serious concerns about the effect of the proposed development on the wildcat population at Clashindarroch.
"However, it has not been established that the decisions made by the reporter and ultimately by the ministers were attended by any error of law.
"In those circumstances there is no room for intervention by the court.
"For the reasons stated, I shall sustain the first pleas-in-law for the respondents and the interested party respectively, repel the petitioners' pleas, and dismiss the petition."
A Vattenfall spokesperson said: "This is a welcome decision which completely vindicates the Scottish government's decision to award planning consent to Clashindarroch II Wind Farm.
"Vattenfall's wind farms are designed to both reduce carbon emissions and protect wildlife, and Vattenfall have been working closely with stakeholders such as NatureScot in preparing our environmental plan.
"Our existing wind farm in the forest has already been generating electricity for over eight years with no negative impact on the wildcat population, where we have improved the habitat to provide further cover for the wildcats to hunt and roam."
A spokesperson for Wildcat Haven said: ''Wildcat Haven is naturally very disappointed with the outcome of its petition to the Court of Session, as protecting wildcats at Clashindarroch Forest is such a critical part of the conservation work we do.
"We, of course, respect the judge's decision. We are reviewing the decision in detail with our legal team, and will then consider our next steps.
"There are many members of the public who share our serious concerns about the effect of this proposed development on wildcats at Clashindarroch, and we are extremely grateful to everyone who has supported our work to date."
A Scottish Government spokesperson said: "We are pleased to note the outcome of this challenge."