In the event of an energy crisis, Germany will keep two nuclear power stations open and on stand-by.
The two plants were to be closed by the end of the year, but will stay open until mid-April of next year.
German Economy Minister Robert Habeck said in a Monday statement that the country has a very high supply security for electricity.
There is a tense situation in the energy markets and we are doing everything we can to avoid a gas shortage.
Russia is the main supplier of piped natural gas to Germany. It now faces a potential energy shortage in winter as Russia has shut down natural-gas flows via a critical line that supplies natural gas to Germany and beyond.
There won't be crisis situations or extreme scenarios. I am the Minister responsible for security of supply and I do everything I can to guarantee it.
The two nuclear plants would only be activated when necessary, according to Habeck.
The decision to keep the nuclear plants open is a big deal since Germany has stopped using nuclear energy. The anti-nuclear movement in Germany started in the 70s.
The Green Party, which was born of the anti-nuclear movement, has changed its position on the switch off of all of Germany's nuclear reactor this year. Habeck is a member of the green party.
Habeck said that they had to prepare for the worst. When more power is required, the plants will reopen.