The yen fell to a fresh 24-year low in the 139 level against the U.S. dollar in Tokyo on Thursday amid growing prospects of aggressive rate hikes by the Federal Reserve, with the weakening Japanese currency helping stocks to end higher.

The 225-issue Nikkei Stock Average ended up 164.62 points, or 0.62 percent, from Wednesday at 26,643.39. The broader Topix index finished 4.28 points, or 0.23 percent, higher at 1,893.13.

On the top-tier Prime Market, gainers were led by farm and fishery, marine transportation and precision instrument issues.

A currency monitor at a foreign exchange house in Tokyo on July 14, 2022, shows the dollar spurting to the lower 139 yen range. (Kyodo) ==Kyodo

At 5 p.m., the dollar fetched 139.09-11 yen compared with 137.38-48 yen in New York and 137.04-05 yen in Tokyo at 5 p.m. Wednesday.

The euro was quoted at $1.0036-0038 and 139.59-63 yen against $1.0053-0063 and 138.18-28 yen in New York and $1.0032-0034 and 137.48-52 yen in Tokyo late Wednesday afternoon.

The yield on the benchmark 10-year Japanese government bond was flat from the previous day's close at 0.230 percent.

The yen slid to the 138 zone against the dollar in the morning, its lowest level since September 1998, after a stronger-than-expected U.S. consumer price index fueled expectations that the Fed will implement a large interest rate hike in the upcoming policy meeting to tame rising inflation.

The consumer price index, released Wednesday, surged 9.1 percent in June from a year earlier, rising at the fastest pace in more than 40 years and exceeding the market consensus expectation of 8.8 percent.

"The Fed's possible 1 percent rate hike in July, that may be followed by a 0.75 percent increase in September, will lead to a widening of the U.S.-Japan interest rate gap," as the Bank of Japan maintains its monetary easing policy, said Norihiro Fujito, senior investment strategist at Mitsubishi UFJ Morgan Stanley Securities Co.

The yen then fell to the 139 yen level in the afternoon as traders from Europe started buying the dollar amid inflation concerns in the United States and a rise in the 2-year Treasury yield during after-hours trading, dealers said.

Domestic importers in Japan also bought the dollar for settlement purposes, contributing to the yen's weakness, they added.

The weak yen prompted stocks to turn to positive territory after they opened lower, tracking overnight losses on Wall Street, analysts said.

An eventual drop in the long-term U.S. Treasury yield lifted some technology shares such as Amazon in New York, also supporting Japanese technology shares, Fujito said, adding the weak yen also boosted such issues in Tokyo. Falling bond yields lead to lower borrowing costs for companies.

Tokyo Electron surged 1,410 yen, or 3.3 percent, to 43,690 yen while Advantest climbed 120 yen, or 1.7 percent, to 7,220 yen, and TDK gained 45 yen, or 1.2 percent, to 3,925 yen.

Nikkei heavyweights also drew buying. Fast Retailing, operator of the Uniqlo clothing chain, gained 1,030 yen, or 1.5 percent, to 70,130 yen, and SoftBank Group rose 47 yen, or 0.9 percent, to 5,385 yen.

However, investors refrained from chasing higher ground ahead of the release Friday of consumer confidence data from the University of Michigan, analysts added.

Among Prime Market issues, advancing issues outnumbered decliners 1,051 to 697, while 90 ended unchanged.

Trading volume on the Prime Market rose to 972.78 million shares from Wednesday's 893.56 million.