A multi-million pound windfarm development has been halted in its tracks by Law Lords after people living nearby complained the work was polluting the water supplies to their homes.
Scotland's top civil court has rejected an appeal by England-based developer Community Windpower to push ahead with a 15-turbine development on Sneddon Law, East Ayrshire, after it was blocked by council planning officials.
In what is thought to be a first for Scotland, the local authority ordered the company to stop digging on the site after it failed to ensure that water supplies to around 20 households living nearby would remain uninterrupted.
People living in the area complained that silt and other contaminants were coming through their taps, and one young family were left completely without water after test holes dug by the firm cut them off.
The dispute led to a lengthy legal fight which East Ayrshire Council has now won, although the company could still appeal.
Local resident Rachel O'Connor, a former medical consultant, said that she was delighted with the judgment, which she believes will force Community Windpower to honour an obligation to ensure water supplies are maintained before the wind farm can be built.
Mrs O'Connor said: "We were in a pretty desperate plight. Water is crucial to life and if you do not have access to it then there's little choice but to move.
"What we want to see is our water supplies restored and secured, and this judgment says they will be if the wind farm goes ahead.
"What we did not want to see was the developer complete the windfarm and then wash their hands of the whole situation and walk away."
The area around Sneddon's Law is not connected to the main water system, with nearby homes and farms receiving supplies from private sources, such as streams, wells and boreholes.
Community Windpower was given the go-ahead to begin building the windfarm in 2015, but first had to carry out a "satisfactory" water risk assessment (WRA) being carried out by the developer.
However, permission was then withdrawn after over concerns about the quality of the assessment, and the company appealed to Scottish Government Ministers for approval.
The Government's planning reporter overruled the local authority, but said "fully operational" water supplies would still have to be place before work could begin.
But Community Windpower began test drilling in January this year without meeting the new conditions and the local authority was forced to call a halt to the development, a decision which has now been backed by judges at the Inner House of the Court of Session.
Mrs O'Connor said: "Community Windpower have not actually addressed the underlying deficiencies in what they have to do to provide sustainable safe water supplies, but have instead spent a large amount of money taking the Council to Court for having the temerity to delay their construction.
"This is not about saving the planet or reducing carbon emissions and everything to do with money and providing returns to already wealthy investors, at the expense of a basic human right; the need for adequate supplies of safe water.
"This is something that every city-dweller takes for granted when they turn on the tap; its something that we know to be a precious resource."
A spokesman for East Ayrshire Council said: "We took this action as we considered the planning conditions which required mitigation work on private water supplies within the site, before the development began, had not been fully implemented and we considered the unauthorised commencement of works posed a significant, imminent risk to those supplies.
"The Appeal decision upholds our actions in issuing the Stop Notice, which had been temporarily suspended, pending this judgement."
No-one from Community Windpower was available to comment.