By Anthony Harrup

MEXICO CITY--Mexico registered its third consecutive monthly trade surplus in August as both exports and imports recover from industry shutdowns in April and May because of the coronavirus.

The country had a record $6.12 billion surplus in goods trade last month, with exports down 7.7% from a year before at $36.98 billion and imports down 22% at $30.86 billion, the National Statistics Institute said Monday.

Petroleum exports were down 11% from August 2019 on lower oil prices, while imports of fuels such as natural gas, gasoline and diesel fell 38%. Exports of manufactured goods were down 8.3% at $33.54 billion, including an 11.9% drop in shipments of vehicles and auto parts.

Imports of intermediate goods used in production processes were off 20%, and consumer goods imports excluding petroleum fell 31%.

While remaining below year-earlier levels, trade continued to recover from large declines in April and May when many industries were closed due to the coronvirus pandemic, both in Mexico and its main trade partner the U.S.

Exports have been recovering faster than imports and are expected to be the main driver of a recovery in economic activity which contracted 18.7% in the second quarter from a year before.

The August results brought the accumulated trade surplus for the first eight months of the year to $14.57 billion, with a $23.8 billion surplus in nonpetroleum goods partially offset by a $9.23 billion deficit in petroleum trade.

Write to Anthony Harrup at anthony.harrup@wsj.com