BERLIN (Reuters) - German annual inflation slowed sharply in December, slipping below the European Central Bank’s target level just as it ended a crisis-fighting bond purchase scheme after four years and as global markets slumped.

German consumer prices, harmonized to make them comparable with inflation data from other European Union countries, rose by 1.7 percent year-on-year after an increase of 2.2 percent in the previous month, the Federal Statistics Office said on Friday.

A Reuters poll had suggested the annual harmonized consumer price inflation (HICP) rate would slow to 1.9 percent. On the month, HICP rose by 0.3 percent in Germany, Europe’s largest economy, compared with the forecast for a 0.4 percent increase.

The ECB targets inflation of close to but below 2 percent for the euro zone as a whole. December’s weaker German annual inflation rate was marked by a pronounced slowdown in gains to energy prices, which are notoriously volatile.

The ECB says it looks through changes in the inflation rate if it does not believe they affect the medium-term outlook for price stability.

Data released earlier on Friday showed Spanish EU-harmonized consumer prices rose by 1.2 percent year-on-year in December, compared with a consensus forecast of 1.6 percent and previous reading of 1.7 percent.

“Preliminary December inflation data in Germany and Spain support our view that inflationary pressures are easing at the headline level owing to declining energy prices, but they remain broadly stable at the underlying level as neither core goods nor core services prices appear to be on an accelerating path,” Barclays analyst Fabio Fois said in a research note.

In a precarious balancing act, the ECB earlier this month formally ended its 2.6 trillion euro ($2.98 trillion) bond-buying scheme but promised to keep feeding stimulus for years into an economy struggling with an unexpected slowdown and political turmoil.

The central bank said on Thursday the global economy is set to slow down in 2019 and stabilize thereafter, but it still expected prices to rise.

The ECB’s problem is that growth is weaker than expected even just weeks ago, while the outlook is clouded by the threat of a global trade war, the prospect of a hard Brexit and Italy’s budget standoff with the European Commission.

But its bond purchase scheme - dubbed ‘quantitative easing’ - had run its course and any extension would have hit the ECB’s credibility after it flagged the program’s end back in June.

The ECB promised this month to keep interest rates at record lows at least through next summer and its president, Mario Draghi, made no attempt to change market expectations that a first post-crisis rate rise will come only in early 2020.

($1 = 0.8728 euros)