A farmer may have to take down his wind turbine after judges ruled it impacted on a nearby listed church.
The 41.8m-high (137ft) turbine at Upper Pengarth, near Builth Wells, was built last year following approval by Powys council.
But London's Court of Appeal said the council needs to reconsider the move.
It was found to have failed to give "special regard" to preserving the setting of the Grade II-listed Llanbedr Church.
The church is about one mile (1.5km) from the turbine, on the other side of a hill.
Although the turbine, owned by farmer Colin Bagley, could not be seen from the church, both might appear in more distant views, the court was told.
The council might have decided that that impact would be acceptable, but it "had to confront the issue" and its failure to do so was "deficient and therefore unlawful," judges ruled.
Lord Justice Lindblom urged the council to "lose no time" in reconsidering the turbine's future.