The dollar dropped on Thursday after data showed that headline consumer prices unexpectedly fell in June, with the Japanese yen at one point gaining more than 2% as traders priced in the likelihood that the Federal Reserve will begin cutting interest rates in September.

The sharp gain in the yen increased speculation that the Bank of Japan may be intervening to shore up the currency, which fell to a 38-year low against the greenback last week.

But analysts said the move was most likely related to repositioning, with many traders being caught on the wrong side of the market.

"I'd say most likely it's position squaring rather than any official moves," said Steve Englander, head of global G10 FX research and North American macro strategy at Standard Chartered Bank NY Branch in New York.

Thursday's data showed the consumer price index dipped 0.1% last month after being unchanged in May, and posted an annual gain of 3%, the smallest in a year.

Core prices rose by rose 0.1% in June, for an annual gain of 3.3%.

The yen has suffered from a wide interest rate differential with the United States and positions betting on further losses in the Japanese currency versus the dollar "have piled up", Englander said. But today's CPI data indicates that a September rate cut is "highly probable", and so "that rate differential story erodes," he said.

Traders are now pricing in a 91% probability of a rate cut in September, up from 75% on Wednesday, according to the CME Group's FedWatch Tool. A second cut is also likely by December.

The dollar index was last down 0.66% at 104.28 and got as low as 104.07, the lowest since June 7.

Against the yen, the dollar fell 1.95% to 158.49 and got as low as 157.4, the weakest since June 17.

The euro gained 0.45% to $1.088 and reached $1.090, the highest since June 7.

(Reporting By Karen Brettell; Editing by Toby Chopra and David Evans)