German imports and exports rose in March slightly after falling the previous month in a further sign that Europe's largest economy is slowly pulling away from a contraction at the end of 2012 despite weakness in its euro zone neighbors.
Data from the Federal Statistics Office on Friday showed exports rose by 0.5 percent versus February, bang in line with expectations, while imports increased by 0.8 percent, less than the consensus forecast for a 1.5 percent rise in a Reuters poll.
"This is a modest recovery from February's sharp fall. Overall, exporters are holding up pretty well, which is somewhat surprising because of the problems in the euro zone and the weak phase in the world economy," said Christian Schulz, senior economist at Berenberg Bank.
(Read More: Bundesbank's Weidmann Says ECB Still Has Room to Act)
Exports have traditionally been the backbone of the German economy but foreign trade is expected to be a drag on growth this year due to weakness in the euro zone, where Germany sends 40 percent of shipments.
A breakdown of unadjusted data showed exports to the euro zone falling by some 7.0 percent in March compared to the same period last year, while exports to countries outside of Europe dropped by 2.6 percent.
Economists warned the outlook for exports was not rosy and said Germany would have to rely more on consumer spending, buoyed by a robust labor market and wage rises, to support growth this year.
"Japan is a competitor which with the extremely weak yen can take market share from German companies. The euro zone remains in recession with no recovery likely before the second half of the year," Schulz said, adding exports would not be a growth driver.
The increase in imports offers hope to struggling countries in the single currency bloc seeking to offload more of their goods on Germany.
The German economy grew strongly during the early years of the euro zone crisis but it lost momentum last year, with weakness in foreign trade and a lack of investments driving it to a 0.6 percent contraction in the fourth quarter.
Most economists expect it to skirt a recession by growing moderately in the first three months of this year and the trade data supports that theory, especially as it comes on the heels of data showing industrial orders and output rose in March.
Other recent data from Germany has been mixed, with some forward-looking indicators like business and investor sentiment worsening though consumer morale remains firm. April data showed the private sector contracted and unemployment rose, suggesting Germany may suffer another contraction in the second quarter.
The seasonally-adjusted trade surplus narrowed slightly to 17.6 billion euros from an upwardly-revised 17.7 billion in February. The consensus forecast was for it to narrow to 16.5 billion euros.