TOKYO (AP) _ Buoyed by a weaker yen and declining imports, Japan's merchandise trade surplus jumped nearly 50 percent in 1997 _ the first increase in five years, the government announced Thursday.

The surplus climbed to 10.008 trillion yen ($78.7 billion), the Japanese Finance Ministry said.

The surplus in 1996 totaled 6.738 trillion yen ($53 billion at current exchange rates), the ministry said.

Japan's politically sensitive trade surplus with the United States also surged, rising 41.7 percent to 5.025 trillion yen ($39.5 billion) in 1997, marking the first rise in three years.

Analysts have blamed a weak Japanese economy and lower demand for imports for the increase in the surplus. A national sales tax hike that went into effect April 1 has curtailed consumer spending in Japan.

At the same time, automakers and other manufacturers have been boosting exports to offset weak sales at home.

In addition, a weaker yen has made the price of Japanese goods more attractive overseas, while also making foreign products more expensive in Japan.

The surging surplus could spark a resumption of trade friction with the United States, where officials have repeatedly warned Japan not to export its way out of an economic slump.

Currency markets appeared to shrug off the report, however. The dollar was trading at 127.18 yen at mid-morning, slightly below 127.22 yen shortly after the report was released.

Also Thursday, the ministry announced that the trade surplus for the month of December advanced, rising 40.9 percent compared to the previous year. It marked the ninth straight monthly year-on-year increase in the surplus.

December's unadjusted surplus, which is measured as goods pass customs but before adjustment for seasonal factors, was slightly lower than expected by local economists.

Japan's trade surplus with the United States climbed 25 percent to 487.25 billion yen ($3.83 billion) in December, the ministry said.