Japan's current account balance swung back into the black in February from its second-biggest deficit on record in the previous month, providing some respite for policymakers amid a deterioration in economic fundamentals.

Soaring fuel costs and a weak yen have expanded the nation's trade deficit in recent months, more than offsetting heavy returns on investment and pushing the country's current account balance into the red.

The world's third-largest economy ran a current account surplus of ¥1.65 trillion ($13.28 billion) in February, Finance Ministry data showed Friday, against a median market forecast for a ¥1.44 trillion surplus.

That followed a ¥1.19 trillion deficit in January, the second biggest shortfall in comparable data since 1985.

The trade deficit narrowed to ¥176.8 billion in February from ¥1.6 trillion in January.

The primary income surplus, meanwhile, widened to ¥2.27 trillion from ¥1.28 trillion, although that was smaller than in the same month last year due to shrinking foreign investment returns, the data showed.

The smaller trade gap and larger primary income surplus helped push the current account back into positive territory.

Japan is particularly vulnerable to soaring fuel and raw material costs, as it relies almost entirely on imports for energy — adding to uncertainties about its already fragile recovery from the pandemic.

Some analysts have warned that Japan's worsening terms of trade and current account balance, if they persist, could erode market trust in the country's ability to pay back debt and work to weaken the yen further.