The nation’s surplus in the broadest measure of trade expanded 40.2 percent in April from a year earlier as exports outpaced imports, the Finance Ministry said Monday.

The surplus in the current account, which measures not only trade but investment flows and cash transfers, rose year-on-year for the third month in a row to 1.18 trillion yen, according to the preliminary figures.

But factors underlying the recent shrinking surplus in goods-and-services trade — the main ingredient of the balance — remain unchanged, a ministry official said.

These factors are higher oil prices and the improvement seen in the economy, both of which boost imports, and the yen’s appreciation, which may reduce exports.

The official also pointed to fluctuation in the surplus in goods-and-services trade that reflected irregular factors in the past several months.

The surplus in merchandise trade — exports minus imports — rose 8.6 percent to 1.28 trillion yen, making it the biggest component of the current-account balance.

Total exports increased 8.3 percent, with a surge in electronic parts such as semiconductors toward the United States, Europe and the rest of Asia.

Imports meanwhile gained 8.2 percent as crude oil imports jumped in value terms. The average yen-based oil price in April was 86 percent higher than a year earlier.

Both exports and imports increased for six straight months, although imports have been generally stronger during the period.

The service deficit came to 510.6 billion yen, down 126.8 billion yen, partly because of smaller deficits in advertisement and research services.

As a result, the surplus in goods-and-services trade totaled 773.6 billion yen, up 41.8 percent, after a 17.4 percent decrease in March.

The income account, which includes income from Japanese investment in foreign securities, left a surplus of 502.6 billion yen, up 133.7 billion yen. This was attributed to a surplus in income from direct investment overseas.