A High Court judge in London quashed a Welsh assembly decision backing the Ffos-y-Fran scheme.
Elizabeth Condron launched a test case against a plan to extract 10m tonnes of coal over the next 17 years.
Mr Justice Lindsay said it was possible minister Carwyn Jones was "biased" in favour of the scheme and told the assembly government to reconsider.
A fair-minded observer, hearing the words which Jennie Jones attributes to Carwyn Jones AM on learning that the minister was to be chair (of the committee) dealing with the application the next day would, in my view, conclude that there was a real possibility that that member... was biased
Mr Justice Lindsay
He made the ruling after it was claimed the minister made up his mind to back the scheme before the planning meeting was held.
Opponents had said they would suffer noise, dust and vibration problems from one of the biggest opencast sites in Europe, with 20,000 tonnes of coal extracted each week.
Objectors, some of whom would have been living 40m away, claimed it would threaten properties at the edge of the town, including three schools, with dust and noise pollution.
The judge said there was an "unacceptable possible pre-determination" in the assembly's planning decision committee before the decision on 11 April.
The judge reached his view as a result of comments alleged to have been made by Mr Jones ahead of the meeting he chaired at which the green light was given for the scheme.
The judge said retired civil servant and objector Jenni Jones had claimed that Mr Jones told her the day before the meeting he was "going to go with the inspector's report" backing the scheme.
The judge said that there was no clear denial in respect of the alleged statement, and he concluded that there had been an "unacceptable possible pre-determination" on the part of Mr Jones.
The judge said: "A fair-minded observer, hearing the words which Jennie Jones attributes to Carwyn Jones AM on learning that the minister was to be chair (of the committee) dealing with the application the next day would, in my view, conclude that there was a real possibility that that member... was biased..."
The planning application, submitted by Miller Argent (South Wales) Ltd, was given permission following a public inquiry into the third and final chapter of a larger project known as the east Merthyr reclamation scheme.
In papers before the court, the assembly government argued that official policy only recommended the use of buffer zones, rather than insisting on them, or setting any minimum size.
It claimed that the inspector took the matter into account, but decided that no buffer zone was necessary as there would be only a slight deterioration in air quality and the effects on the health of the community would be "negligible".
A Welsh Assembly Government spokesperson said the ruling meant the assembly will now be asked to go through the decision-making process again.
"We are now actively considering whether to appeal against the judgement.
It added that Carwyn Jones had already been cleared, by the independent Commissioner for Standards, of any misconduct.
"He was not advised that a witness statement from him was necessary, and as a result did not have the opportunity to comment during the case," a statement read.
"The minister is adamant that the comments attributed to him were never made, and is disappointed that he did not have the opportunity to state this to the court."