TOKYO - Japan's annual core consumer inflation ticked up only marginally in October despite the boost from a sales tax hike during the month, suggesting weak household sentiment is keeping companies from passing on the higher costs.

The data underscores the challenge the Bank of Japan faces in firing up inflation to its elusive 2% target, as soft global demand and the U.S.-China trade war cloud the outlook for the export-reliant economy.

The nationwide core consumer price index (CPI), which includes oil costs but excludes volatile fresh food prices, rose 0.4% in October from a year earlier, government data showed on Friday.

That matched a median market forecast and followed a 0.3% increase in September.

Excluding the impact of the sales tax hike rolled out in October and the introduction of free child-care, annual core consumer inflation was 0.2% in October, slowing from 0.3% in September.

Yasunari Ueno, chief market economist at Mizuho Securities, expects inflation to stagnate and force the BOJ to maintain its ultra-loose monetary policy for a prolonged period, given weak services prices.

"It's nearly impossible for consumer inflation to sustainably hit 2% in Japan," he said.

Prime Minister Shinzo Abe proceeded with a twice-delayed sales tax hike in October to 10% from 8% as part of efforts to rein in Japan's huge public debt.

The boost from the tax increase was offset partly by the introduction of free child-care, which is aimed at easing the pain on households from the higher levy.

While rising labour and raw material costs pushed up the price of dining out, electricity bills pushed down CPI for the first time in nearly three years due to falling fuel costs, the data showed.

However, analysts said the data also showed the tax hike has so far not had the sort of negative impact on consumption that a similar hike in 2014 did in welcome news for policymakers.

"The muted rise in inflation in October supports our view that the recent sales tax hike won't derail consumer spending," said Marcel Thieliant, senior Japan economist at Capital Economics.

Japan's economy ground to a near standstill in the third quarter with growth at its weakest in a year as the U.S.-China trade war and soft global demand knocked exports, keeping pressure on policymakers to ramp up stimulus to bolster a fragile recovery. 

(Reporting by Leika Kihara; Editing by Sam Holmes) ((leika.kihara@thomsonreuters.com; +813-6441-1828; Reuters Messaging: leika.kihara.reuters.com@reuters.net))