WASHINGTON—The U.S. imported a record amount of goods in September, while the trade deficit with China rose to its highest level ever, despite intense efforts by the Trump administration to close the trade gap.

The foreign-trade deficit in goods and services increased 1.3% from the prior month to $54 billion in September, the Commerce Department said Friday. A surge in products purchased from abroad helped widen the gap, with the value of imported goods ballooning to $218 billion, the highest level on record. Meantime, imports...