The U.S. trade deficit decreased to $50.8 billion in April in a reading just before its tariff battle with China escalated, according to government data Thursday.

The number matched analyst expectations and marked a decline from an upwardly revised $51.9 billion in March.

In the weeks before President Donald Trump stepped up his rhetoric on China, the deficit increased $2.1 billion to $29.4 billion as exports fell by $1.8 billion and imports increased by $300 million, numbers from the Census Bureau and Bureau of Economic Analysis showed. That came after the trade shortfall with China increased $22.9 billion in the first quarter to $80.8 billion.

Overall for the month, exports fell $4.6 billion to $206.8 billion while imports declined $5.7 billion to $257.6 billion.

Along with its China battle, the White House also has gone after Mexico recently, threatening to impose a 5% tariff on Monday against Mexico imports, with equal increases each month to a maximum of 25%. The administration has demanded that Mexico stem the flow of illegal immigrants at the southern border.

The U.S. had a goods shortfall with Mexico of $7.9 billion for April, after a $23 billion deficit in the first quarter.

The deficit in goods and services stands at $205.4 billion for the year, a 2% increase from the same period a year ago.

In the bigger picture, trade is likely to be neutral for growth in the second quarter after serving as a big boost to the surprisingly large GDP gain of 3.1%, said Michael Pearce, senior U.S. economist at Capital Economics. Trade added 1.1 percentage points to GDP in Q1.