Poland and Czech Republic have reached an agreement to resolve a dispute over the expansion of the Turow mine, which is located on the Polish side of the border with the latter.

According to the deal, Poland agreed to pay €45m ($50.8m) in compensation for infrastructure upgrades and other environmental safeguards, reported Reuters.

In exchange, the Czech Republic will withdraw its complaint against Poland filed at the Court of Justice of the European Union.

With the agreement in place, Poland will continue to operate the Turów mine and power plant, which is said to be a key element of Poland’s energy security.

Poland Prime Minister Mateusz Morawiecki said: “Today we are opening a new chapter in Polish-Czech relations, looking to the future with optimism. We need it as neighbours and as countries on the eastern flank of the European Union and Nato.”

Morawiecki said that the country will also launch additional mechanisms to ensure clean air and access to water while protecting the environment on both sides of the border.

The two parties also agreed to cooperate to implement and finance activities to detect, reduce and prevent the effects of the Turów mine’s exploitation and rehabilitation works, in the Czech Republic.

Furthermore, the contract will see the establishment of a Polish-Czech Just Transformation Commission to draft a Just Transition Strategy for the region. It will include representatives of local self-governments.

The deal comes soon after the Luxembourg-based Court of Justice of the European Union (CJEU) advocate general Priit Pikamäe said that Poland’s extension of the Turow mine’s operational life without assessing its environmental impact breaches European Union law.