The decision, largely prompted by the disaster at Japan's Fukushima nuclear plant, was reached on May 30 by parties in Chancellor Angela Merkel's coalition government.
Under the plan, the government will not reactivate eight reactors that were closed before or immediately after the Japanese disaster. Environment Minister Norbert Roettgen said another six reactors would be taken offline by 2021, while the final three reactors, Germany's newest, would be closed in 2022.
Roettgen said the government had largely followed the recommendations of an ethics panel appointed by Merkel after the Fukushima crisis to study the future of nuclear energy in Germany.
The coalition's Christian Democratic Union (CDU), its Bavarian sister party the Christian Social Union (CSU), and junior coalition partner the Free Democrats (FDP) met on May 29 to discuss the report.
After late-night talks in the chancellor's office, the parties agreed to keep one of the country's older reactors as a reserve for 2013 in case renewable energies or fossil fuels failed to meet winter demand.
Nuclear power covers 23 percent of Germany's energy needs.
Some politicians had lobbied for a clause allowing for the agreement to be revised in the future. But Roettgen said the shutdown was "irreversible."
Germany's planned nuclear pullout marks a striking policy reversal for Merkel, who had pushed through measures in 2010 to extend the lifespan of the country's 17 reactors -- with the last one scheduled to go offline in 2036.
Strong public opposition, galvanized by the Fukushima disaster, had forced her to backtrack and close the seven oldest nuclear plants pending safety inspections.
Speaking today at a news conference in Berlin, Merkel said Germany must now "follow a new path" to safer energy.
"The work of the ethics commission has shown that our energy system must be fundamentally changed, but also that it can be fundamentally changed," she said. "We want the electricity of the future to be safer, while being reliable and economically viable at the same time."
Merkel said the country's energy supply chain needed "a new architecture" that would require huge efforts to develop renewable energies, increase efficiency gains, and overhaul the electricity grid.
She voiced confidence that the decision to abandon nuclear power would get parliament's approval.
"It will be one of these cases when a commission report will not be put away in a drawer," she said. "It will translate into concrete actions very soon."
While the transition away from nuclear power will require billions of euros of investment, some experts say the move could eventually place Germany at the forefront of a rapidly developing market for renewable energy technologies.
"As an industrial nation, Germany believes that now is the best time to develop and introduce new technologies," Nosrat Vaheedi, a retired professor of nuclear science at Munich's Ludwig Maximilian University, told RFE/RL. "If these technologies prove successful in Germany, they could find their place in the world market, too."
To a large extent, Merkel's decision is a political one.
Mounting hostility to nuclear power in Germany has helped boost the Greens, which won a landmark electoral victory in one of the CDU's stronghold states, Baden-Wuerttemberg, in March.
Tens of thousands of people demonstrated across the country this weekend against nuclear energy. Greenpeace activists unfurled a huge banner on top of Berlin's Brandenburg Gate that read: "Every day of nuclear power is one too many."
compiled from agency reports, with contributions from RFE/RL's Tajik Service