A jump in energy-related exports and a steep decline in oil imports lowered the U.S. trade deficit in December to nearly a three-year low.
The improvement suggests the economy grew in the October-December quarter instead of shrinking as the government estimated last week.
A brighter outlook for trade also illustrates how a boom in oil and gas production is reducing crude oil imports and making the U.S. a leader in the export of fuels. And it shows that higher domestic sales of fuel-efficient cars are lowering dependence on oil.
The trade gap fell nearly 21 percent in December from November to $38.6 billion, the Commerce Department said Friday.
Total exports rose 2.1 percent to $186 billion, driven in part by record exports of gasoline, diesel and other fuels.
At the same time, imports declined 2.7 percent to $225 billion. That was largely because oil imports plunged to 223 million barrels — the fewest in 15 years.
"While we may see some give back in the coming months ... the trend of a narrowing petroleum trade gap will continue to drive improvement in the overall trade balance," said Michael Dolega, an economist at TD Bank, said in a note to clients.
A narrower trade gap boosts growth because it means U.S. companies earned more from overseas sales while consumers and businesses spent less on foreign products.
Fewer exports were one of the reasons the government's first estimate of economic growth in the October-December quarter showed a contraction at an annual rate of 0.1 percent. The December trade deficit figures were not available when the government reported its estimate last week.
Some of the gain from trade will be offset by a decline in December wholesale stockpiles.
Overall, economists at Barclays Capital expect the government's second estimate for fourth-quarter growth will be revised up to a still-weak annual rate of 0.3 percent.
The monthly trade figures can be volatile. Still, economists see the trade picture brightening in 2013, helped by new technology that has made U.S. fuel cheaper.
Production of oil and natural gas is surging in the U.S. because drillers have learned to tap once-inaccessible reserves trapped in shale formations. New techniques such as horizontal drilling and hydraulic fracturing, or fracking, have made this possible.
Increased production has lowered U.S. prices of crude oil and natural gas, which refiners use to make gasoline, diesel and other fuels. Crude in the U.S. has been selling for $20 per barrel cheaper than international crude. U.S. natural gas is half the price of natural gas in Europe and one-third the price in Asia.
With lower input costs, U.S. refiners are making enormous amounts of petroleum-based fuels and selling them on the international market at a huge profit.
For all of 2012, the trade deficit narrowed 3.5 percent to $540.4 billion.
Many economists believe that trade will give the economy a small lift in 2013. That forecast is based on an assumption that the European debt crisis will stabilize, helping boost U.S. exports to that region, and economic growth in Asia will continue to rebound.
"The drag from Europe has lessened," said Mark Vitner, an economist at Wells Fargo.
The politically sensitive trade deficit with China rose to $315.1 billion last year, the largest on record with any country. That could add to pressure on the Obama administration and Congress to take a harder line on China's trade practices. Some U.S. manufacturers contend that China keeps the value of its currency artificially low to make its exports to the U.S. cheaper.
AP Energy Writer Jonathan Fahey contributed to this report from New York. Follow Chris Rugaber on Twitter at: http://Twitter.com/ChrisRugaber