FRANKFURT — The once seemingly unstoppable German economy had the slowest growth of any eurozone country except Italy at the end of 2018, according to data published on Thursday that brought the impact of President Trump’s trade war into stark relief.

Germany’s economy did not grow at all in the year’s final quarter, and it barely avoided sliding into recession, the government statistics agency said.

One reason for the slowdown was conflict over trade. American tariffs are hurting German steel makers’ sales, and Germany is also experiencing collateral damage caused by a trade war between China and the United States.

The economic data was bad news for the rest of Europe. Germany has the region’s largest economy, and it typically sets the pace for the rest of the eurozone. The country has often helped haul its neighbors through periods of crisis, but it may no longer be able to play that role.