Japanese shares rose for a fourth day Friday, with the 225-issue Nikkei average closing above 40,000 for the first time since January, on trade optimism after the United States and China signed a deal and the White House hinted U.S. President Donald Trump may soften his July tariff deadline.

The broader Topix Index rose 1.3% to 2,840.54 as of market close in Tokyo, with the blue-chip Nikkei climbing 1.4% to 40,150.79.

Exporters such as carmakers were among the biggest contributors to gains, with Toyota and Honda outperforming the Topix. Chip names like Disco were also strong, helping lift the Nikkei.

¡°There are signs of progress on the trade front, and some investors are expecting an extension of the deadline for reciprocal tariffs,¡± said Yutaka Miura, a senior technical analyst at Mizuho Securities.

The White House press secretary said on Thursday that Trump¡¯s July 9 trade deal deadline is ¡°not critical.¡±

¡°This is all positive for stocks, and drove U.S. shares higher Thursday, prompting buying across the Topix and Nikkei indexes,¡± Miura said. The Nikkei¡¯s rise beyond the 40,000 level is further boosting sentiment, with large-cap names like autos among the main beneficiaries, he added.

Defense-related shares were some of Friday¡¯s top gainers, with Kawasaki Heavy Industries rising as much as 8.2%, the most since April.

NATO members¡¯ agreement to raise security spending to 5% of gross domestic product this week is propelling the sector higher on speculation Japan¡¯s government will follow suit, said Norikazu Shimizu, an analyst at Iwai Cosmo Securities.

¡°Japan¡¯s defense budget is likely to come up in U.S.-Japan trade negotiations, providing defense stocks another tailwind,¡± said Shimizu. ¡°With tensions in the Middle East, the ongoing war in Ukraine, and the possibility of China invading Taiwan, I don¡¯t think defense stocks¡¯ rally will end any time soon.¡±

The momentum is palpable in markets across the region, with the MSCI¡¯s Asia index climbing to a four-year high. ¡°The Middle East conflict has calmed, trade deals appear to be getting done and we have increased optimism of Fed rate cuts,¡± said Nick Twidale, chief analyst at AT Global Markets. ¡°That¡¯s pushing through to global markets.¡±