A new £10m solar farm at Broughton Gifford may have to be dismantled after the owner of Grade II listed Gifford Hall won a ruling in the High Court that the planning permission was unlawful.

One of the country’s top judges, Mr Justice Dove, quashed the planning permission, and ordered Wiltshire Council to reconsider the application for the 22 hectare solar farm at Broughton Gifford. The successful challenge was brought by Daniel Gerber, of Gifford Hall.

Mr Gerber claimed he only became aware of the development when the photovoltaic arrays were being installed, and argued that the council had failed to consult conservation body English Heritage before granting permission.

Now, despite the fact that the solar farm started producing power last June, the judge has placed its future in doubt.

The judge ruled that the council should have consulted Mr Gerber as owner of Gifford Hall and had breached his "legitimate expectation" that he would be notified of a development proposal of this sort.

And he found that, as the council had considered that the solar farm development would have an effect on listed buildings in the area and as the Conservation Area, "English Heritage should have been consulted".

He said: "It follows that from the record of the decision, the listed building and its setting was affected. This needed to be evaluated. The statutory scheme requires English Heritage to have the chance to input into that evaluation. It is precisely the matter on which English Heritage's expert views should be sought. The failure to do so in this case was in my view a clear legal error."

He also found that the council had failed in its duty to have "special regard" to the desirability of preserving the setting of listed buildings and had carried out a "flawed" assessment of environmental issues.

He said: "The question which needs to be answered, and which is not directly addressed anywhere in the screening opinion, is whether or not this development would be likely to have significant environmental effects."

Site operators Norrington Solar Farm Limited and Terraform Power had argued that the installation cost £10.5 million and that restoration of the site would cost £1.5 million, with only an "uncertain" second hand market for the panels. They argued that the judge should exercise his discretion not to quash the decision.

The judge said that he attached significant weight to this factor, adding: "It is safe to conclude that the interested parties would suffer serious financial prejudice if the planning permission were quashed and the development required to be moved from the land completely."

However, ruling that the permission should be quashed, he concluded: "The issues in relation to Gifford Hall have not been considered properly. The status of Gifford Hall as a Grade II* listed building and the failure to give its interests a proper and lawful consideration attracts in my view very significant weight in the overall balance of considerations.

"The proper consideration of the interests of a nationally protected heritage asset and observing the requirements of EU environmental law are, in my view, or particular importance to the question of discretion in this case. In the circumstances I am satisfied that it is appropriate for the planning permission to be quashed."