The U.S. trade deficit widened for the second straight month in July, reaching the highest level since February, as imports hit an all-time high. The deficit in goods with China set a record.

The Commerce Department says the deficit in goods and services — the difference between what America sells and what it buys from other countries — rose to $50.1 billion in July from $45.7 billion in June. Exports slipped 1 percent to $211.1 billion. Imports increased 0.9 percent to a record $261.2 billion.

The deficit rose despite efforts by President Donald Trump to bring it down by re-negotiating trade agreements and imposing taxes on imports.

The goods deficit with China rose 10 percent to a record $36.8 billion. The gap with Mexico plunged 25 percent to $5.5 billion.