(FILES) In this file photo taken on May 20, 2022 Cars of the Volkswagen (VW) group are transported by rail on the compound at production site of the German carmaker in Emden, northern Germany
Output rose two percent on the previous month after rebounding 3.7 percent in January, seasonally adjusted figures from the federal statistics agency Destatis showed.
Factset analysts had expected industrial production to stagnate in February.
The outlook for companies brightened in the first quarter "with the order situation remaining good and supply bottlenecks gradually disappearing", the German economy ministry said in a statement.
The automotive industry was a major contributor to the rebound, with production up 7.6 percent compared to January.
There was also improvement almost across the board in the most energy-intensive sectors.
This showed that industry has probably "hit the bottom" of the energy crisis caused by the war in Ukraine, the ministry said.
Compared to February 2022, industrial production increased slightly, by 0.6 percent.
The figures come a day after leading economic institutes said Europe's largest economy was expected to dodge a recession and grow by 0.3 percent this year.
German industrial orders also saw a surprise jump of 4.8 percent in February compared to the previous month.
The encouraging data "take away the risk of a technical recession" and represent "a strong comeback for German industry", said ING analyst Carsten Brzeski.
But he cautioned that Germany could still expect "only subdued growth in the months ahead".