Plans for a super-prison in Port Talbot have been withdrawn after strong objections in the community, according to prisons minister Rory Stewart.
In 2017 the UK government announced it was planning a new Category C super-prison for up to 1,600 prisoners on undeveloped land in Baglan Moors.
But the plans proved unpopular and local MP Stephen Kinnock said last April it had been put on hold.
Mr Stewart has confirmed an alternative location was now being sought.
"We do not want to repeat the experience of Port Talbot where we decided to go somewhere and suddenly found there was a strong community objection to it," he told last week's Welsh Affairs Select Committee.
The Welsh Government had also sold the land so it was "no longer a viable site", said Mr Stewart during the meeting last Tuesday.
A Welsh Government spokesperson said: "We have written to the Ministry of Justice to inform them we will not facilitate any further prison development without meaningful and thorough discussion about the future estate as part of a holistic approach to penal policy in Wales."
Neath Port Talbot council said it welcomed "further confirmation that the prison is not going ahead".
Mr Kinnock said it was "a real victory for the people of Port Talbot" after nearly 9,000 people signed a petition against the plans.
Welsh Secretary Alun Cairns said the Baglan site had been ruled out last October.
"Since then we have been engaging with landowners to see where suitable locations are and we'll continue to do so on that basis," he said.
A Ministry of Justice spokesperson said it was "committed to building a prison in south Wales" and it would "continue to listen to local communities".