Chancellor Angela Merkel's government has decided to close Germany's eight remaining coal mines by 2018, sounding the death knell for a sector that still employs 35,000 people.
However, the phase-out will be reviewed by parliament again in 2012 to see if its still makes economic sense. And the agreement pledges to avoid forced redundancies. "The miners are definitely secure," said Social Democrat leader Kurt Beck, who took part in the talks.
The agreement has been approved by the mining trade union and the RAG conglomerate that operates the coal mines, and even got the blessing of the Social Democrat party which has long fought to slow down the decline of an industry doomed by cheap imported coal.
Seven of the remaining mines are in the western state of North Rhine-Westphalia, home to the Ruhr industrial region, and one is located in the small state of Saarland on the border with France. At present Germany's federal and regional governments subsidise coal mining by up to €2.5 billion a year and the deal ensures continued financial support for the sector until the last mine is closed.
The agreement also paves the way for the stock market flotation this year of RAG, which plans to focus on its profitable "white activities" consisting of real estate, power stations and chemicals production. Proceeds from that flotation will be used to pay for miners' pensions and for repairing some of the damage mining has done to the environment.
The deal does not affect Germany's brown coal mining sector which can produce coal more cheaply because it uses open-cast mines.
Coal mining powered Germany's industrial revolution in the 19th century and helped spawn the country's oldest political party, the Social Democrats. Although mining has been in decline for decades here as in other western European countries, successive governments have propped it up with heavy subsidies to preserve jobs and communities.
The Ruhr industrial region that was once crowded with pit heads and the smoking chimney stacks of coking plants and steel mills, has been transforming itself for years, turning power stations into leisure parks, slagheaps into parkland, gas storage tanks into exhibition halls and disused mines into museums.
The area is intensely proud of its heritage. Rows of spruced up mining cottages line the outskirts of cities such as Dortmund, Duisburg and Essen and have been placed under monument protection along with the steel hulks of pit heads. Many areas have been struggling to cope with the decline, however. The Ruhr town of Gelsenkirchen, for example, has an unemployment rate of 15.6 percent, on a par with cities in the economically depressed east of Germany.
German black coal production has shrunk from 150 million tons in 1957, the heyday of the postwar economic miracle, when the industry employed 607,000 miners, to 25.6 million tons in 2005, according to figures from the Statistik der Kohlenwirtschaft organisation.
Around 20 million tons is used to fire German power stations, with 6 million tons used in the steel industry. Over 20 percent of German electricity is generated using German-mined black coal, according to 2005 figures.
The country was the world's fifth-largest coal importer in 2005 according to figures from the World Coal Institute. China is the world's main coal producer, followed by the USA, India and Australia.
Conservative daily Frankfurter Allgemeine Zeitung said it was high time Germany shut down its coal mines. "The bad news is that it will take another 11 years. The taxpayer will have to pay another €30 billion until then for the production of coal than can be imported at less than half the price."
Yet supporters of retaining coal mining in Germany point out that keeping at least some of the pits open limits Germany's dependence on imports and provides a base for the country's world-leading mining equipment industry. On top of the mining jobs, the industry ensures tens of thousands of jobs among local suppliers and support services, its supporters argue. RAG estimates Germany has enough coal reserves in the ground to last 400 years.
They also say Germany must not go down the same road as Britain under Margaret Thatcher who crushed trade union resistance in a battle to privatize the industry in the 1980s. She slashed subsidies and thereby triggered a haemorrhaging of jobs from which former mining regions of northern England, Wales and Scotland have yet to recover despite years of economic growth since then.
Britain's mines now employ just 7,000, down from 220,000 in 1985. The decline in Germany has been more gentle, from 166,000 in 1985 to 35,000 now.
Opponents of the German mining industry point out that there are ample supplies of coal in many politically secure parts of the word and that Germany will have reliable access to the resource long after it stops producing its own.