But Merkel now says industrialized, technologically advanced Japan's helplessness in the fact of the Fukushima disaster made her rethink the risks of the technology.
"We want the electricity of the future to be safe, reliable and economically viable," Chancellor Angela Merkel told reporters on Monday after overnight negotiations among the governing parties. "We have to follow a new path."
While Germany already was set to abandon nuclear energy eventually, the decision -- which still requires parliamentary approval -- dramatically speeds up that process.
Germany's seven oldest reactors, already taken off the grid pending safety inspections following the March catastrophe at Japan's Fukushima Dai-ichi nuclear power plant, will remain offline permanently, Environment Minister Norbert Roettgen said.
The country's energy supply chain "needs a new architecture," necessitating huge efforts in boosting renewable energies, efficiency gains and overhauling the electricity grid, Merkel said.
The determination of Germany, Europe's largest economy, to gradually replace its nuclear power with renewable energy sources makes it stand out among the world's major industrialized nations. Among other members of the Group of Eight, only Italy has abandoned nuclear power, which was voted down in a referendum after the 1986 Chernobyl disaster.
Until March -- before the seven reactors were taken offline -- just under a quarter of Germany's electricity was produced by nuclear power, about the same share as in the U.S.
Energy from wind, solar and hydroelectric power currently produces about 17 percent of the country's electricity, but the government aims to boost its share to around 50 percent in the coming decades.
Many Germans have been vehemently opposed to nuclear power since Chernobyl sent radioactive fallout over the country. Tens of thousands of people repeatedly took to the streets after Fukushima to urge the government to shut all reactors quickly.
A decade ago, a center-left government first penned a plan to abandon the technology for good by 2021 because of its inherent risks. But Merkel's government last year amended the plan o extend the plants' lifetime by an average of 12 years -- a decision that became a political liability after Fukushima was hit by Japan's March 11 earthquake and tsunami disaster.
"This is a great day of relief for all opponents of nuclear energy in Germany," said Sigmar Gabriel, leader of the opposition Social Democrats. "Today, our political opponents are forced ... to accept our policies."
Merkel's government ordered the country's seven oldest reactors, all built before 1980, shut down four days after problems emerged at Fukushima. The plants accounted for about 40 percent of the country's nuclear power capacity.
Shutting down even more reactors, however, will require billions of euros (dollars) of investment in renewable energies, more natural gas power plants and an overhaul of the country's electricity grid.
Germany, usually a net energy exporter, has at times had to import energy since March, with the seven old reactors shut down and others temporarily taken off the grid for regular maintenance work.
Still, the agency overseeing its electricity grid said Friday that the country will remain self-sufficient.
The government has stressed that Germany must not rely on importing power from its nuclear-reliant neighbors.
Environmental groups welcomed Berlin's decision.
"The country is throwing its weight behind clean renewable energy to power its manufacturing base and other countries like Britain should take note," said Robin Oakley, Greenpeace UK's campaigns director.
Germany's industry umbrella organization said the government must not allow the policy changes to lead to an unstable power supply or rising electricity prices, both of which would affect the country's competitiveness.
"Transforming the energy sector is a hugely demanding project," said Hans-Peter Keitel, the president of the Federation of German Industries.
He urged the government not to set the nuclear exit date of 2022 in stone, but to agree on a date that would be adjustable if problems arise in the coming years.
The coalition government's decision broadly follows the conclusions of a government-mandated commission on the ethics of nuclear power, which delivered recommendations on how to abolish the technology within a decade on Saturday, and presented them Monday.
"Fukushima was a dramatic experience, seeing there that a high-technology nation can't cope with such a catastrophe," said Matthias Kleiner, the commission's co-chairman. "Nuclear power is a technology with too many inherent risks to inflict it on us or our children."
The shares of Germany's four nuclear utility companies were down Monday. The biggest of them, E.ON AG and RWE AG, slipped by about 2 percent, to euro19.62 and euro40.05 respectively.
Neighboring Switzerland, where nuclear power produces 40 percent of electricity, also announced last week that it plans to shut down its reactors gradually once they reach their average lifespan of 50 years -- which would mean taking the last plant off the grid in 2034.