TOKYO — Japan’s consumer price index rose 0.4 percent in 2013, the first increase in five years, in further evidence the recovery in the world’s third-largest economy is gaining momentum.

A flood of cash from central bank asset purchases and other government spending has underpinned demand, helping to boost growth despite a weakening in Japan’s trade balance.

A tax hike due to take effect April 1 is expected to dent growth in coming months, however, as consumers tighten their belts to compensate.

Much of the increase in prices stems from rising costs for imports of food and costly crude oil and natural gas. Excluding those, prices rose 0.2 percent.