Consumer prices in June rose the most since 2008, 0.4 percent from a year earlier, an early sign that Japan's economy may be starting to shake off deflation, the Internal Affairs and Communications Ministry said Friday.

The median estimate of 29 economists was for a 0.3 percent gain, excluding fresh food, a Bloomberg News survey showed. Excluding energy as well, prices dropped 0.2 percent, continuing more than four years of declines.

As Prime Minister Shinzo Abe's policies weaken the yen and energy costs rise, the increase in prices points to a gradual shift away from the deflation that has dragged on the economy for 15 years. With the Bank of Japan rolling out unprecedented monetary easing from April, the next challenge for Abe is to loosen constraints on the labor market and companies to achieve sustained growth and the BOJ's 2 percent inflation goal.