BERLIN (AP) -- The German economy shrank for the first time in nearly four years in the second quarter as consumer spending and capital investment declined, according to government figures released Thursday.
Europe's biggest economy contracted by 0.5 percent in the April-June period compared with the previous quarter, the Federal Statistical Office said. It was the first decline since the third quarter of 2004.
However, it was less sharp than the 0.8 percent decline economists had predicted. The government said it was sticking to its forecast for full-year economic growth of 1.7 percent.
The contraction in gross domestic product contrasts with healthy growth of 1.3 percent in the first quarter -- revised downward Thursday from the 1.5 percent initially reported.
The German economy was widely expected to have slowed significantly in the second quarter amid worries over an economic slowdown across Europe. Recent data have showed a persistent decline in industrial orders, while indexes of business, investor and consumer confidence have been sliding.
The quarter "was characterized by decreasing household final consumption expenditure and smaller fixed capital formation," particularly in the construction industry, the statistics office said in a statement.
It said that foreign trade made a "positive contribution," but that was largely due to a significant decrease in imports. Strong exports have been a key driver of Germany's economic upswing over recent years.
"Clearly, the growth dip in spring could have been worse," said Andreas Rees, an economist at UniCredit in Munich. He noted that the dip was driven by "technicalities," such as the fact that the construction industry was unusually strong in the first quarter.
He pointed to the weakness in industrial orders as a worrying sign for the coming months -- but also argued that lower oil prices and the euro's retreat from all-time highs against the U.S. dollar offer a "silver lining on the horizon."
"For the second half of this year, we believe in moderate and clearly below-potential growth, but not in an outright recession," Rees wrote in a research note.
He forecast 2 percent growth for the full year, but said the economy would grow by less than 1 percent in 2009 as slowing demand from the euro zone, the U.S. and elsewhere weighs on exports.
Economy Minister Michael Glos conceded that "the financial market turbulence, the rise in oil prices and the decline of the U.S. dollar are now showing effects on Germany."
However, he argued that Germany's competitiveness and ability to weather global economic risks has improved over recent years -- so "the government can stick to its deliberately cautious growth forecast of 1.7 percent for this year."
Glos did not address the 2009 outlook. The government is forecasting 1.2 percent growth next year.
Despite the quarter-on-quarter drop, Thursday's report showed that GDP grew by 3.1 percent compared with last year's second quarter -- or 1.7 percent in calendar-adjusted terms, since the period had more working days this year.