BANGKOK, July 5 (Reuters) - Thailand's headline consumer price index (CPI) rose 0.62% in June from a year earlier, after the previous month's annual increase of 1.54%, the commerce ministry said on Friday.

The June figure compared with a forecast increase of 1.12% in a Reuters poll, and against the central bank's target range of 1% to 3%.

The core CPI, which excludes volatile food and energy prices, was up 0.36% on the year.

In May, the headline CPI rose 1.54% from a year earlier, returning to the central bank's target range of 1% to 3% for the first time in a year.

In the first six months of 2024, average annual headline inflation was 0.0%, with the core rate at 0.41%.

The commerce ministry retained its headline inflation forecast for the year of between 0% to 1%.

The Bank of Thailand (BOT) has said it expects headline inflation to be below the target range in the third quarter before returning to the range in the fourth quarter. (Reporting by Orathai Sriring, Kitiphong Thaichareon and Thanadech Staporncharnchai; Editing by Ed Davies)