A delegation from Warsaw and a trade union grouping on Friday signed the deal covering the main points of a transitional arrangement, following a week of negotiations and strike action.
Warsaw has assured the unions that subsidies will be used to keep the coal sector alive until 2049. Poland relies on coal for 80% of its power, but needs to reach an EU target of net-zero carbon emissions by 2050.
The country's leaders had baulked last week at EU chief Ursula von der Leyen's proposal to raise the bloc's 2030 target for cutting greenhouse gas emissions from 40% to 55%. Over 200 miners also launched a strike in Silesia, the main mining region, by staying underground after their shifts ended.
The agreed model represents "a fair path to the transformation of the Polish mining and energy industry," said deputy minister of state assets Artur Soboń.
"We signed the liquidation of one of the most important industries in the history of the Republic of Poland," Dominik Kolorz, head of the Solidarity trade union in Silesia, said of the deal.
Mining unions had sought a slower transition towards reducing coal's role in the country's power generation.
The government has said it will seek permission from the European Commission to provide state aid "for financing the current production, in order to ensure the stability of the hard coal mining companies".
The Silesian coalfields have been active since the mid-1800s, and during the 1970s the country became one of the world's biggest producers of hard coal. National reserves of hard coal are estimated at 45.4 billion tonnes.