German unemployment surprisingly rose in May in adjusted terms, data from the country's labor agency showed Wednesday.

According to seasonally adjusted data, unemployment increased by nearly 24,000 on the month in May, after falling by nearly 25,000 in April. Economists polled by The Wall Street Journal ahead of the release had forecast a decline of 15,000 in the unemployment total. The adjusted unemployment rate stayed unchanged at 6.7%, in line with expectations.

The increase in adjusted unemployment was largely due to weather factors, the agency said. In unadjusted terms, unemployment actually fell by 61,000 in May. The agency said that this decline was smaller than is usually the case this time of year. "The reason is that unemployment rose less strongly in winter because of the unusually mild weather," meaning that it then declined faster and earlier. "Therefore, in seasonally adjusted terms, unemployment rose by 24,000," this month said the agency.

"All in all, the labor market is in good shape," said Frank-Juergen Weise, head of the labor agency.

Domestic strength in Europe's largest economy will continue to be the main driver of economic growth, experts say. Earlier in the week, the consumer researcher GfK reported that consumer confidence remains stable at a high level, defying concerns that the crisis in Ukraine would weigh on sentiment.

"Stable employment prospects and the associated increases in income coupled with extremely moderate inflation all contribute to establishing perfect general conditions in Germany for high willingness to consume," wrote GfK.

Write to Todd Buell at todd.buell@wsj.com