Industrial production was 1.2% higher than in April, exceeding an average analyst forecast of 0.8% compiled by Dow Jones Newswires. That followed a revised decline of 0.8% in April, which the ministry had initially estimated at 0.6%.
On July 6, the ministry said industrial orders had gained a monthly 1.8% in May, with an 11.3% gain in domestic orders offsetting a decline of 5.8% from abroad.
It said that in light of the "rather moderate" increase in orders, output growth "might be calmer in the months to come."
The German economy is officially expected to expand by 2.6% this year following growth of 3.6% in 2010, but Chancellor Angela Merkel has said the forecast could be raised above 3% in the coming months.
A breakdown of the data on a monthly basis showed an increase of 2.5% in the production of capital goods and a rise of 1.1% in construction.
That sector had slumped by 5% in the previous reading.
Output of consumer goods stagnated in May however, after a slight increase of 0.5% in April.
Berenberg Bank senior economist Christian Schulz remained upbeat nonetheless, saying: "The strength of the German industrial sector is independent of the ongoing sovereign debt crisis, as long as financing conditions remain benign.
Schulz noted that "we expect a mid-summer lull before the expansion reaccelerates in the autumn."
Copyright Agence France-Presse, 2011