BRUSSELS — Germany’s once unstoppable economy has gone into reverse, adding another threat to European stability just as Italy escalated its dispute with fiscal overseers in Brussels.

The European Union’s bedrock economy unexpectedly shrank 0.2 percent in July through September compared with the previous quarter, according to data published Wednesday by Germany’s official statistics agency. It was the first quarterly contraction since 2015, with a drop in exports suggesting the stall was a manifestation of President Trump’s trade war with China.

If the quarterly decline in Germany signaled a trend — which some economists doubted — the implications for the rest of Europe would be ominous at a time when Italy is rattling financial markets. Italy’s populist government, which faced a deadline Tuesday to resubmit a national budget earlier rejected by the European Commission, made only minor concessions. The commission, the European Union’s executive arm, is expected to respond next week.

As Europe faces a confluence of economic and political turbulence, Germany and its powerful auto and machinery exporters have provided crucial stability.