Controversial plans to build 200 homes on an old army camp have been rejected by the Brecon Beacons National Park.
The £50m scheme at Cwrt-y-Gollen, near Crickhowell, Powys, had been recommended for approval.
But the park's planning committee voted against the scheme.
The development, close to the A40, would have also included a nursing home for the elderly, pre-school childcare and industrial units.
The national park and Powys council have been in dispute over part of the proposal for the Ministry of Defence (MoD) land.
Last week, Powys council indicated it might seek legal advice on a possible challenge if the park authority approved the scheme.
Landowner Crickhowell Estates was seeking planning permission for the homes, although the MoD retains part of the land adjoining the development for a firing range and other facilities.
Despite strong opposition, the park authority's planning officer recommended that its members back the development on Tuesday.
Concerns have also been expressed about the size and scale, its location by a busy road and partially on a flood plain.
Opponents said local services would struggle to cope with such a large influx of residents and that this could threaten existing communities.
A local housing market assessment recently concluded that just 129 new homes were needed in the Crickhowell and surrounding area up to 2014.
The Campaign for National Parks is also opposed to Cwrt-y-Gollen, saying its scale is "unprecedented".
Crickhowell Estates had said it consulted widely on the proposals, which it believes would bring a number of benefits to the local community of Glangrwyney.