The leaders of the Czech Republic and Poland agreed a deal on Thursday to end a long-running dispute over the Turow open-pit coal mine on the Polish side of the border, a row that had reached the European Union's top court.
Polish Prime Minister Mateusz Morawiecki and his Czech counterpart Petr Fiala signed the agreement in Prague.
Fiala, speaking at a joint news conference, said the deal would bring benefits to Czech communities that have been impacted by the mine, providing compensation of 45 million euros ($50.8 million) to help finance infrastructure upgrades in the region affected.
Under the deal, Morawiecki said, the Czech Republic had agreed to withdraw its court challenge.
The deal comes after talks between the central European allies failed last year to settle a dispute over environmental harm caused by the massive mine.
Fiala's new government, which took office in December, revived the negotiations that focused on compensation and environmental safeguards, such as an underground barrier to protect water sources.
The Czechs have complained the mine is sucking up underground water from wells in nearby Czech villages and causing other damage.
The row erupted after Warsaw decided to extend Turow's operation beyond an earlier announced deadline, because of its significance for the economy and energy supplies. It has sought a deal to end legal disputes.
The EU's top court ordered Poland last year to halt mining pending an outcome to Czech legal challenges.
The court has also ordered a daily fine of 500,000 euros ($564,000) for Poland over its refusal to stop operations, which Warsaw has also refused to pay.
An adviser to Europe's top court sided with the Czech legal challenge earlier on Thursday, saying Poland breached EU law when extending the life of Turow without assessing the environmental impact.
($1 = 0.8856 euros)
(Reporting by Joanna Plucinska, Anna Koper, Marek Strzelecki and Pawel Florkiewicz in Warsaw, and Jason Hovet and Robert Muller in Prague; Editing by Simon Cameron-Moore, Clarence Fernandez and Tomasz Janowski)