Japan posted two straight years of export gains in February, led by solid U.S.-bound shipments of cars, although expectations of a strong recovery in demand are quickly fading amid global monetary tightening and worries about banks worldwide.

The world's third-biggest economy has struggled to make a solid post-COVID recovery, undermined by lacklustre household consumption and a global slowdown.

Slowing shipments to China, which fell for a third straight month, have also shattered policymakers' hopes for a quick rebound from the pandemic doldrums.

The Ministry of Finance (MOF) trade data released on Thursday showed exports grew 6.5% year-on-year in February, driven by U.S.-bound shipments of cars but undershooting a 7.1% increase expected by economists in a Reuters poll. It followed a 3.5% rise in the previous month.

Exports to China, Japan's largest trading partner fell 10.9% year-on-year in February, registering a second straight month of double-digit decline, as demand weakened for cars, auto parts and display-making equipment.

Imports rose 8.3%, versus the median estimate for a 12.2% increase, resulting in a trade deficit of 897.7 billion yen ($6.75 billion). The yen's 13.5% depreciation versus the dollar made the costs of energy imports even higher.

Japan has now posted a trade deficit for 19 straight months.

The Japanese economy narrowly averted a recession in the final months of 2022, as consumption remained weak while exports were hampered by slowdown in global growth.

Monetary tightening across the world, supply chain constraints and the Ukraine war have undercut Japan's recovery.

"Chances are 50-50 that Japan may slide into recession," said Takeshi Minami, chief economist at Norinchukin Research Institute.

More optimistically, the leading gauge of business investment showed a strong reading, providing a glimmer of hope for a potential pick-up in private demand.

The data released on Thursday showed core machinery orders rose 9.5% in January from a month earlier, the biggest rise in more than two years.

Ramping up investment to meet post-pandemic demand, service sector companies' orders jumped 19.5% to a level last seen in November 2019.

However, orders from manufacturing companies fell 2.6% dragged down by metal, electronics and auto firms due to the weak global economy and reduced demand for semiconductors. ($1 = 132.9600 yen) (Reporting by Tetsushi Kajimoto; Editing by Simon Cameron-Moore)