St Andrews University said it was "delighted" after a government Reporter upheld its proposal to build six 100m-high wind turbines on Kenly Farm, near Boarhills, to the east of the town.
The turbines faced objections from community councils, residents' groups and local golfing businesses including the Old Course Hotel, and were unanimously refused planning permission by Fife councillors.
However, the university appealed to the Government in September 2012 after criticising Fife Council's handling of the application as unfair.
The university hopes the turbines will generate 12MW of electricity, letting it cut its £5 million-a-year energy bill.
The wind farm would also help the university reach its goal of becoming carbon neutral by reducing its carbon footprint by about 18,000 tonnes.
A university spokesman said: "We await the full detail of the Reporter's decision, but are delighted that our appeal has been upheld and that this important project can finally go ahead.
"Kenly has always been central to our efforts to generate our own clean, green power, reduce our exposure to crippling external energy price-rises and protect local jobs in Fife.
"We recognise that our plans for Kenly prompted passionate opposition from some people, but also very significant levels of support from within the local community. We remain fully committed to open discussions with local people about the detail of a community benefit scheme."
John Goodwin is chair of Kenly Landscape Protection Group, which has spent four years campaigning against the proposal.
He said: "We are baffled why the Reporter decided the undoubted impact on residential amenity at Kenly was acceptable.
"Some 97 homes lie within 2km of the wind farm, which will inflict an overbearing visual impact, noise and shadow flicker on many of them," he said.
"People's enjoyment of their homes will be diminished and house prices will inevitably fall. Similarly, holiday homes and other rental accommodation will find it harder to find tenants."