A secret ecovillage that was only discovered during an aerial survey of a Welsh national park will not be demolished after it was finally approved.

After a 10-year planning row, authorities at Brithdir Mawr, in Pembrokeshire, ruled that the settlement - made up of timber-framed, turf-roofed roundhouses resembling Bilbo Baggins' home in the Lord of the Rings - could stay.

The inhabitants secretly built the sustainable village and lived there unnoticed until the aerial survey was carried out in 1998.

The villagers were threatened with eviction and the authorities said the roundhouses, built of straw, timber, recycled glass, clay and manure, must be torn down.

However, the villagers fought back and, after a decade of hearings, court cases and inquiries, the settlement has been saved from destruction.

The village relies on solar power and a wind turbine for electricity, and has compost toilets, reed beds, a workshop and a hay barn.

Water is collected locally, and the villagers survive by working the land and carrying out craft industries such as woodcarving.

The Pembrokeshire coast national park authority gave the village the green light after it adopted a new policy on sustainable, low-impact developments.

A spokeswoman said that meant the community would have to make a "positive environmental and social/economic contribution to the area".

"It was pleasing that support could be given at this stage for this longstanding, complicated case," she said.

The national park authority will review the decision in three years.