The Ifo institute's closely watched business climate index for Europe's top economy rose to 102.4 points in December from 101.4 points a month earlier, beating analysts' expectations.
Economists polled by Dow Jones Newswires forecast a score of 102.0 points.
"While companies assessed their current business situation as somewhat less favourable than last month, they were considerably less pessimistic about future business developments," the Munich-based institute said.
"As the year draws to a close, German companies are more confident about the future."
The survey found that the mood was particularly bright in manufacturing and construction but soured slightly in wholesaling and retailing.
Ifo calculates its headline index on the basis of companies' assessments of their current business and the outlook for the next six months.
The sub-index measuring current business dropped to 107.1 in December from 108.1 points in November, but the outlook sub-index jumped to 97.9 points from 95.2 points.
In November the business climate index rebounded after a six-month nosedive propelled by deep uncertainty in the euro area.
Unlike many of its neighbours, Germany has shown strong resistance to the debt crisis that has swept through the 17-country bloc, relying on its powerful export motor to keep the economy humming. But weakness in the eurozone has begun to take its toll.
After expanding by 0.5 percent in the first quarter of 2012, gross domestic product (GDP) grew by just 0.3 percent in the second quarter and a mere 0.2 percent in the third quarter.
The Bundesbank said on Monday that the German economy was set to contract "noticeably" in the fourth quarter of this year and will probably tread water early next year, before the country goes to the polls in a general election expected in September.
Annalisa Piazza, an analyst with Newedge Strategy, said that the second increase back-to-back in the Ifo pointed to renewed confidence that the eurozone would succeed in finally taming its three-year-old debt crisis.
"It seems to suggest that industrialists are now less concerned about the possible 'catastrophic' effects of a euro break-up and they can now be more focused on the real development of activity," she said.
"Panic seems to have somehow receded with some progress on the EMU debt crisis and hope that the ECB (European Central Bank) will use all tools available to support the economy going forward."
But she added: "On the other hand, we still see a weak picture for activity in the months ahead as the real economy is far from being out of the woods."
Economist Ben May at Capital Economics in London noted that the rise in the Ifo index was positive but that the score itself was still relatively weak.
"December's small rise in the German Ifo business survey is moderately encouraging news, but the index still points to economic stagnation in the near term," he said.
Meanwhile Constantin Wirschke of Natixis said he and his colleagues were more bullish.
"While we agree that Q4 will be weak, we are not quite as pessimistic, and we also expect Q1 to be marginally improved," he said, referring to the fourth quarter of 2012 and the first quarter of 2013.