One of Europe's largest opencast mining projects can go ahead in south Wales, the Court of Appeal has decided.
The Ffos-y-Fran scheme is expected to create 200 jobs
The Welsh assembly first approved the Ffos-y-Fran scheme at Merthyr Tydfil in February last year.
But the High Court quashed the decision after it was claimed Environment Minister Carwyn Jones had made his mind up before the planning committee met.
Mr Jones denied the claim and the Welsh assembly took the case to appeal judges, who have now given approval.
Residents had campaigned against the scheme, which will lead to the extraction of 10m tonnes of coal over 15 years.
The High Court challenge centred on a claim that Mr Jones - who chaired the meeting which granted approval - had told an objector the day before that he was "going to go with the inspector's report" backing the scheme.
High Court judge Mr Justice Lindsay said it was possible Mr Jones had been "biased" in favour of the scheme.
But the assembly government said the judge reached the wrong conclusion.
Mr Jones remained adamant he never made the reported comment and said he was "disappointed" that he did not have the opportunity to state that to the court.
He was also cleared of any misconduct by the independent commissioner for standards.
The minister said he was "pleased" at the appeal court decision and that the planning decision's committee had been found to be "robust".
Mr Jones added extracts in the judgment set out what he had said in the conversation with one of the opencast protesters and the reasons why he had not given evidence earlier.
"The witness statements from which those extracts are drawn were not formally admitted in evidence but would, I believe, have set the record straight about what was said or not said during that conversation."
In the long-running dispute, campaigners claimed that they would suffer noise, dust and vibration problems from the site, with 20,000 tonnes of coal extracted each week.
After Monday's hearing campaigner Alison Austin said: "We're bitterly disappointed. We'll take any avenue open that's left to us.
"If we have to take it to Europe obviously that's the way it's going to be."
Developer Miller Argent (South Wales) Ltd said it welcomed the go-ahead for the mine.
Company spokesman James Poyner said: "The delay has cost us two years and is measured in millions of pounds.
"But not just millions of pounds to us, it's also cost the taxpayer an awful lot of money which is very regrettable."
The developer also said it fully appreciated the concerns expressed by some residents.