The widely watched investor confidence index calculated by the ZEW economic
institute soared to 6.9 points in December from minus 15.7 points in November.
It was the highest reading since May and also the first time since then that the index has been in positive territory, the institute said.
"Financial market experts are looking to next year with a bit of pre-Christmas optimism," said ZEW chief Wolfgang Franz.
"The economic slowdown we have seen over the past months will also stretch into 2013. But as things currently stand, Germany will be spared a recession," Franz said.
"Nevertheless, a precondition for this is that the eurozone crisis does not intensify further," Franz added.
For the survey, ZEW questions analysts and institutional investors about their current assessment of the economic situation in Germany, as well as their expectations for the coming months.
The sub-index measuring financial market players' view of the current economic situation in Germany edged up by 0.3 point to 5.7 points. A frequent criticism of the index that it can be volatile and is therefore not particularly reliable.
But the better-than-expected reading for December -- analysts had been projecting a much more modest rise in the index to minus 11.3 points -- fits in with other forward-looking data released recently.
In November, the key Ifo business confidence index halted a six-month slide to stage an unexpected rally.