Last year, Poland was slapped with a €500,000 per day fine for failing to respect an injunction to close the mine.
Warsaw and Prague on Thursday signed a deal on a controversial Polish coal mine near the Czech border.
Czech Prime Minister Petr Fiala and his Polish counterpart Mateusz Morawiecki signed an agreement in Prague on the Turow lignite mine, the Polish Prime Minister's office said on Twitter.
Mateusz Morawiecki added on Friday that Poland has paid the agreed compensation over the dispute.
"The Czech Republic has withdrawn its complaint to European institutions and that is the end of this issue," he told reporters.
Prague had complained the mine was draining water from villages near the border and it had also sparked a stand-off between Brussels and Warsaw.
Earlier on Thursday, an advisor to the European Court of Justice (ECJ), Advocate General Priit Pikamäe, said Poland had broken EU law when extending the life of the mine without an environmental impact assessment.
He said mining activities as large as Turow present a risk of environmental degradation and must necessarily be subject to an assessment, even just for an extension, despite a Polish law stating otherwise.
"Mining activities taking place over a surface area similar to that of the Turów mine present, by their nature, a risk of notable environmental effects and must necessarily be subject to an assessment of their environmental effects," Pikamäe said.
For Belgian lawyer, Geert Van Calster, the opinion comes as no surprise.
"The Environmental Impact Assessment Directive is an old instrument of EU law. It has an important impact on local planning decisions. It now also clearly has an important impact on energy decisions," Van Calster told Euronews.
"But as such, it doesn't come as a surprise. There is a vast body of case law that interprets this directive in a very proactive and a very far-reaching way and I think those of us in the environmental legal community would have expected the advocate general to opine, as indeed he has done today."
The Czech government had said the mine negatively impacts the environment and drains water from local villages.
Poland’s government had countered that the mine fuels a power plant that generates some 7% of the nation’s energy and that it is needed to meet the country's energy demands.
On Thursday, Czech government spokesman Vaclav Smolka said the government had approved a draft deal in relation to the mine.
In October last year, the ECJ fined Warsaw €500,000 per day for failing to abide by an injunction to immediately close the Turów mine.