Japan's Nikkei share average rose to a high on Wednesday in a volatile session as financial stocks outperformed and investors bought shares to capitalize on the latest rally.

After remaining in negative territory for most of the afternoon session, buying expanded towards the end of trading to push the Nikkei to a record high of 41,889.16 points.

The main index closed up 0.61 percent at an all-time closing high of 41,831.99, while the broader Topix index closed up 0.47 percent at a record high of 2,909.20.

The Nikkei index has gained about 25 percent since the beginning of this year until today's close.

Large-cap stocks rose to give the Nikkei a boost, with Uniqlo owner Fast Retailing up 1.4 percent and artificial intelligence-focused SoftBank Group Corp up 0.8 percent.

After seeing early sell-offs following Tuesday’s rally, technology and semiconductor stocks pared losses or turned to gains. Chip-making equipment giant Tokyo Electron Co. pared losses in morning trade to close 1.1 percent higher.

Japan's main stock indexes have risen to all-time highs in the past two weeks, and analysts say corporate earnings due in the latter half of July could push Japanese stocks higher.

Insurance companies jumped 3.5 percent, while securities and banking companies rose 1.3 percent.