Japan's stock benchmark rallied on Friday to the highest since August 1990, the country's "bubble" era, driven by a confluence of positive factors from strong earnings to an economy showing signs of revving up and optimism over a U.S. debt ceiling deal.

The Nikkei benchmark index jumped as high as 30,924.57 before closing the day up 0.77% at 30,808.35, a seventh straight winning session.

The broader Topix, which had reached the post-bubble milestone on Tuesday, extended its climb to as high as 2,171.37, before ending with a more modest 0.18% gain to 2,161.69.

Japan's stock rally has been powered by an overall very strong earnings season, a weaker yen underpinned by views that the Bank of Japan will keep stimulus for longer and an economy that is starting to show signs of a post-COVID consumption revival.

Foreign buying thanks to increased investment by Warren Buffett and a push for better corporate governance by the Tokyo Stock Exchange have provided additional impetus.

The Nikkei's final push to a 33-year peak drew momentum from rising optimism that U.S. lawmakers can reach a debt ceiling deal and avert a catastrophic default.

"Long-term fundamentals might have begun changing in Japan, and foreign investors do not want to miss this opportunity," said Masayuki Kichikawa, chief macro strategist at Sumitomo Mitsui DS Asset Management.

"As long as any U.S. slowdown is mild, the current level of Japanese equities in not overvalued. There is still room for a further rise."

Among the Tokyo Stock Exchange's 33 industry sectors, precision machinery led with a 1.43% rise, followed by services, up 1.35%, and machinery, which rose 1.08%.

Uniqlo store operator Fast Retailing was the biggest gainer by index points on the Nikkei, contributing 74 points with a 2.19% rally.

Office equipment company Ricoh was the biggest percentage gainer, jumping 7.69% on news it was considering joining forces with a Toshiba unit to develop and manufacture copiers and printers.

The prospective deal is another example of how corporate reforms - including business portfolio restructuring - are taking hold in Japan, justifying the rally, said Jamie Halse, who manages an A$500 million ($340 million) Japan-focused fund at Platinum Asset Management in Sydney.

"We're seeing foreigners return to buying in Japan, and we haven't seen that kind of buying since 2013," at the start of co-called Abenomics, he said.

"It's very early innings in the reform process," Halse added. "It's still cheap."

Despite that optimism, the market is flashing some warning signs.

Chip stocks started the day strongly following a rally for U.S. peers, but then erased those gains or even turned sharply lower. Advantest surged 3.35% initially, but ended the day as the Nikkei's worst performer, sliding 2.86%.

Financial shares fell the most among the TSE's 33 industry groups, retreating 1.56% after hitting a two-month peak on Thursday.

"Investors are going to spend today thinking hard about whether this Nikkei rally will continue," said Kazuo Kamitami, a strategist at Nomura Securities.

"The word 'overheated' is going to be very much front of mind." (Reporting by Kevin Buckland; Editing by Shri Navaratnam)