Protesters broke through a police cordon on Saturday into the Garzweiler mine in the country’s Rhineland region.
It came after when 40,000 students rallied for more government action against climate change on Friday in the nearby city of Aachen.
"We wrote climate history this weekend," the activist group End of Story said as it halted the protest. "Our movement has never been so diverse and never been so determined."
The long-planned protests began on Friday just hours after European Union leaders failed at a summit to agree on how to make the EU carbon neutral by 2050.
On Saturday, some demonstrators blocked the railroad tracks used to transport coal before others broke through a police cordon to enter the mine.
Protesters and police accused each other of combative behaviour in the mine and of causing injuries.
Police repeatedly asked protesters to leave warning they faced life-threatening danger. Eight officers were injured in scuffles with protesters, police said.
Police cut the locks the protesters had used to chain themselves to the railway tracks and then carried the protesters out one by one. Inside the mine, some protesters left voluntarily, while others were taken on buses and driven out of the mine. Police took the identities of all demonstrators before letting them go.
German news agency dpa reported that activists claimed police had denied water and food to those who were temporarily detained. Police denied the allegation.
The mine has been the focus of many protests in recent years because the operator, German utility company RWE, planned to cut down a forest to enlarge it.
Later on Sunday, Aachen police tweeted that RWE had filed a criminal complaint against those protesters who had locked themselves to the tracks. The utility company had stopped mining during the three days of protests.
Following months of climate protests by students and a sharp rise in the polls for Germany's Greens party, German Chancellor Angela Merkel recently threw her weight behind the goal of making Germany climate neutral by 2050. That would mean the country's economy no longer would add greenhouse gases to the atmosphere.
Scientists say ending fossil fuel use by mid-century is a must if countries want to achieve the 2015 Paris climate accord's most ambitious goal of keeping global temperatures from rising more than 1.5C compared to pre-industrial times.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies