The German cabinet drew up rules Wednesday on the hitherto unregulated technology of "fracking" in Germany, narrowly restricting its use, but stopping short of an outright ban.
Under the law, fracking will be banned in specified regions "to protect drinking water, health and the environment," the environment and energy ministries said in a statement.
It would also contain "general restrictions for fracking in areas where there are shale, clay rock, marl and coal deposits," the statement said.
On top of this, it entailed stricter rules for conventional gas and oil production.
Fracking or hydraulic fracturing is a process used to extract shale gas by blasting a high-pressure mixture of water, sand and chemicals deep underground to release hydrocarbons trapped between layers of rock.
Environmentalists argue that the process may contaminate ground water and even cause small earthquakes.
The technology is widely used in the United States, helping to keep down energy costs there. But it is banned in some countries in Europe.
In Germany, there have been no clear regulations in the past and the draft legislation aims to remedy that.
"I'm happy that after long discussions, regulations have now been decided for the previously unregulated technology of fracking," said environment minister Barbara Hendricks.
"This law will enable us to circumscribe fracking so that it no longer represents a danger to people or the environment. As long as the risks cannot be fully evaluated, fracking will be banned," Hendricks said.
Energy and Economy Minister Sigmar Gabriel said the cabinet decision would create "legal certainty both for people and for the industry."
Top priority was to protect health and the environment, Gabriel said.
"Fracking can only be used in very restricted exceptional cases and only when the risks are controllable and answerable," the minister said.
Before it could be used, there had to be a fully transparent decision-making process with participation from the general public.
So far, fracking has never been used in Germany in shale, clay rock, marl and coal deposits at depths of less than 3,000 metres. That meant not enough was known about its effects, particularly with regard to the water supply, drinking water and health.
In order to gather such knowledge, fracking would be allowed for research purposes and only when the mixture of water, sand and chemicals did not endanger the water supply, Gabriel said.
Fracking has been largely unregulated in Germany until now, and the current coalition government under Angela Merkel has been working for months to draw up the proposed rules.
The draft law "is not going to allow anything that was previously forbidden. On the contrary, it will ban much that was possible in the past," government spokesman Steffen Seibert told a regular news briefing.
"Legal loopholes will be closed and strict rules will come into force where previously there had been no clear rules," he said.
The draft legislation must now go before the parliament before it can come into force and it is likely to be the object of lively debate.
Nevertheless, the left-right coalition government under Angela Merkel has a majority of 504 seats out a total 631 seats in the lower house of parliament or Bundestag.