Inflation in Europe's biggest economy came in at 2.3 percent from a year ago, preliminary data from federal statistics agency Destatis showed, up from 2.2 percent in June.
That is despite analyst expectations that it would remain unchanged.
Services sector inflation remained elevated, at 3.9 percent, while food price inflation accelerated slightly.
The European Central Bank will be closely watching the latest inflation and growth data as it weighs whether to cut rates again in September, after lowering borrowing costs for the first time since 2019 last month.
READ ALSO: Cost of living - What's getting more expensive (or cheaper) in Germany
'Stuck in crisis'
Meanwhile, the German economy unexpectedly shrank in the second quarter, according to initial results.
Output contracted by 0.1 percent compared with the previous three months, federal statistics office Destatis said, after expanding by 0.2 percent in the first quarter.
The second-quarter data surprised analysts surveyed by FactSet who had forecast a 0.1-percent increase.
The April-to-June period noticeably saw declining investment in equipment and construction, Destatis said.
"The German economy is stuck in crisis," said Klaus Wohlrabe, head of surveys at Ifo economic institute, citing persistent weakness in manufacturing and sluggish private consumption.
"Hardly any improvement is to be expected in the third quarter of 2024 either," he added.
ING economist Carsten Brzeski said that Tuesday's data releases "have not made things any easier" for the ECB.
Sticky inflation in particular "will strengthen the doubts around another rate cut at the September meeting," he added.
Comments