A container ship at the Port of Oakland in Oakland, California.

The U.S. trade deficit increased more than expected in November as imports of goods surged to a record high amid strong domestic demand, making it likely that trade will subtract from economic growth in the fourth quarter.

The Commerce Department said on Friday the trade gap widened 3.2 percent to $50.5 billion. That was the highest level since January 2012 and followed an upwardly revised $48.9 billion shortfall in October.

Economists polled by Reuters had forecast the trade deficit increasing to $49.5 billion in November after a previously reported $48.7 billion deficit in the prior month.

Part of the rise in the trade deficit in November reflected price increases. When adjusted for inflation, the trade deficit rose to $66.7 billion from $65.6 billion in October. The so-called real trade deficit for October and November was above the third-quarter average of $62.0 billion.

That suggests trade will probably subtract from gross domestic product in the October-December quarter. The chronic trade deficit has garnered the attention of Republican President Donald Trump, who has blamed it for the massive loss of U.S. manufacturing jobs as well as moderate economic growth.

The government reported last month that trade contributed 0.36 percentage point to the economy's 3.2 percent annualized growth pace in the third quarter. The Trump administration believes that a smaller trade deficit, together with deep tax cuts, could boost annual economic growth to 3 percent on a sustained basis.

Imports of goods jumped to a record high of $204.0 billion in November. Capital goods imports were the highest on record. Imports of consumer goods rose to their highest level since March 2015. The strong growth in imports is being driven by robust consumer demand.

The country's import bill was also pushed up by imports of industrial supplies and materials, which were the highest since January 2015.

Imports from China were unchanged in November. Exports of goods increased 2.3 percent to $200.2 billion in November, the highest on record. There were strong increases in exports of industrial supplies, petroleum and capital goods.

Overall exports of goods are being supported by recent dollar depreciation and a strengthening global economy, which is helping to underpin the manufacturing sector.

Exports to China fell 1.9 percent. The politically sensitive U.S.-China trade deficit rose 0.6 percent to $35.4 billion in November.