The German government must be careful that its stimulus measures don't spur inflation, German Chancellor Olaf Scholz said on Wednesday.

The coalition government on Tuesday set aside weeks of squabbling to agree to a total of 32 billion euros ($34.84 billion) in corporate tax cuts over four years to boost the flagging economy.

The German economy stagnated in the second quarter, showing no sign of recovery from a winter recession and cementing its position as one of the world's weakest major economies.

Scholz said there were signs that an economic upswing was on the way, after announcing the results of a government retreat outside Berlin.

($1 = 0.9185 euros) (Reporting by Maria Martinez and Thomas Escritt, Editing by Rachel More)