The overall gap in trade in goods and services expanded to $67.1 billion in August from a revised $63.4 billion in July, according to Commerce Department data released Tuesday. The median estimate in a Bloomberg survey of economists had called for a widening to $66.2 billion. The positive balance on services dropped to $16.8 billion.

Total imports increased 3.2% to $239 billion, while exports rose 2.2% from the prior month to $171.9 billion. The nation’s surplus in services shrank to the lowest since 2012. Meanwhile, the merchandise trade deficit expanded to a record high.

The coronavirus pandemic undid some of the Trump administration’s deficit-reduction efforts which were starting to bear fruit before Covid-19 upended demand and supply chains. American businesses, which drew down inventories at the start of the lockdown, have recently increased imports to replenish stocks ahead of the holidays.