Hardenhuish School in Chippenham has been given planning permission to put up a wind turbine and solar panels.
Members of North Wiltshire District Council's development control committee last night agreed the project to create green energy.
But after complaints from people in Long Ridings the school decided to move the turbine down the hill to stop it being an eye sore.
The school argued the 9m pole will be grey and the blades will be black blending in with the surroundings.
It also argued the plan would be helping the environment by lowering their carbon foot print and the energy would be used to run the school.
Deputy head teacher at Hardenhuish School Jan Hatherell said she was thrilled with decision.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article