NEW YORK— The U.S. trade deficit soared in 2022 and reached a historical record of nearly $1 trillion grew because of high oil prices, inflation, and the relative strength of the U.S. economy compared to the rest of the world.

Annual net exports of goods and services rose 12 percent from 2021 to more than $948 billion, according to data released Tuesday by the Department of Commerce. It was the highest trade deficit on record, beating the record set in 2021.

The annual deficit, however, may give an incomplete picture. Net exports peaked in March, just after the war in Ukraine began, driven mainly by a sharp increase in oil prices. The deficit declined later in the year as oil prices eased. Additionally, part of the increase in the deficit is explained by higher prices, since the data are not adjusted for inflation.

“The annual figures are a bit misleading in terms of the latest true trends,” said Shannon Seery, economist of Wells Fargo.

The big trade deficit in the past couple of years was in some ways a sign of the strength of the U.S. economy, especially relative to the rest of the world. Americans were buying imported goods, but the purchase of U.S. products from other countries did not increase.

The decline in the second half of the year reflects in part the slowdown of the US economy. “It is because import growth slowed faster than exports declined at a faster rate, which is not necessarily an indication of strength for the U.S.”, said Seery.

The trade deficit rebounded slightly at the end of the year, rising 10 percent in December after a sharp retraction of 21 percent in November. This was the consequence of both a fall in exports of almost 0.8 percent and an increase in imports of 1.3 percent. But economists said it was really mostly monthly volatility than any trend.

Since the last mid-year, there have been lower imports of industrial supplies and consumer goods, which means that both the manufacturing sector and households are buying fewer goods from abroad. This coincides with other indicators showing a slowdown in the domestic economy: both consumer spending and manufacturing declined in November and December.

The cooling of the economy is one of the expected consequences of the Federal Reserve's policy of raising interest rates to contain inflation. Since 2022, it has raised the rate eight times, most recently on February 1, when it increased to a range between 4.5 and 4.75, the highest in 15 years. One of the effects of this policy is to strengthen the dollar against other currencies. That makes U.S. products less competitive and partly explains the reduction in exports in recent months. On the other hand, it also affects consumer spending in the U.S. and reduces the demand for both domestic and imported products.

But it is not clear whether the economy is actually cooling. GDP grew by 2.9 percent in the last quarter of 2022 and 517,000 jobs were created in January 2023, two figures that exceeded estimates and indicate that the economy is stronger than expected.

That is why some analysts are cautious about the significance of the shrinking of the trade deficit in recent months. Michael Englund, Chief Economist of Action Economics, said the decline might instead represent a seasonal effect, as many imports were brought forward earlier in the year and therefore fewer purchases were to be expected in the final months of the year.

“It is really hard to know if we should attribute some of the weakness in the import export data to necessarily be anything more than seasonal factors,” Englund said. “Until we get January and February data driven by the other side of the holidays, it is going to be hard to know if this slowdown really is significant.”