A businessman waits for the last train at a station in Tokyo early on Aug. 23, 2013. Reuters/Toru Hanai

Japan's core consumer prices rose 0.7 percent in July from a year earlier, marking the second consecutive month of gains and attaining a near five-year high, data revealed on Friday.

The rise in the core consumer price index, which includes oil products but excludes volatile prices of fresh food, compared with economists' median forecast of a 0.6 percent increase, data from the Ministry of Internal Affairs and Communications showed. It followed a 0.4 percent rise in June.