Japan's exports rebounded in July as China replaced the United States as the nation's largest customer but couldn't prevent the trade surplus plunging 87 percent to ¥91.10 billion on surging imports due to higher oil prices.

Shipments overseas rose 8.1 percent from a year earlier, after declining for the first time since 2003 in June, the Finance Ministry said Thursday. Exports to China climbed 16.8 percent to a record ¥1.29 trillion, exceeding the value of those sent to the U.S. for the first time since the government began compiling monthly figures in 1950.

Thursday's number may not be enough to alleviate concern that weakening global demand and surging raw materials costs will tip the world's second-largest economy into a recession. Higher oil prices caused the import bill to climb to a record last month, narrowing the trade surplus, the report shows.