The development had been called into doubt after a judicial review sparked by campaign group Sustainable Shetland saw Energy Minister Fergus Ewing’s consent for the project overturned.
Following a government appeal of that review, judges at the Court of Session ruled that the application by the energy giant was competent, paving the way for the wind farm to go ahead.
The 370MW wind farm is aimed at powering more than 175,000 homes despite Shetland having a population of about 22,000.
It is estimated the wind farm could generate £30 million in annual income for the local community.
Viking Energy Shetland chairman Alan Bryce said: “We are pleased that the judges have found in favour of Scottish ministers, who awarded consent to build the wind farm more than two years ago.”