A Mediterranean Shipping Co. ship loaded with freight containers is seen approaching Long Beach, California, on Friday, Feb. 1, 2013. The U.S. trade deficit fell for the first time in three years in 2012, thanks to record exports combined with a drop in the cost of imported oil. (Tim Rue/Bloomberg)

The U.S. trade deficit fell for the first time in three years in 2012, thanks to record exports combined with a drop in the cost of imported oil and a slowdown in the country’s demand for imported consumer goods.

The outcome, including a nearly 21 percent fall in the monthly trade deficit for December, was quickly hailed by the Obama administration as a sign of success in the battle to better balance the country’s trade relations with the rest of the world.

Along with a fall in the country’s import bill for crude oil, the United States exported a record $11.6 billion of petroleum in December, evidence of the country’s shifting energy landscape. Growth in consumer imports was flat, edging up from $514 billion in 2011 to $516 billion in 2012.

“We’re continuing to make historic progress,” Deputy Commerce Secretary Rebecca Blank said in a statement, noting that a record $2.19 trillion in exports had been achieved despite “global economic headwinds” that undercut trade worldwide.

But the positive developments masked some less-than-stellar news. Exports grew over their 2011 totals by a tepid 4.3 percent — far slower than needed to reach the administration’s goal of pushing exports over $3 trillion by 2014.

The U.S. trade balance decreased.

The trade deficit with China widened to a record $315 billion, and growth in imported autos outstripped that of auto exports. At the same time, U.S. sales to South Korea, party to a new free-trade agreement that administration officials trumpeted as a plus for American business, fell slightly, and the trade deficit with the Asian powerhouse widened from $13.2 billion in 2011 to $16.5 billion last year. U.S. officials noted that the South Korea agreement is still in its early months, and attributed the poor showing to a drop in corn purchases and a slowdown in that country generally.

Exports as a share of total economic output held steady at 13.9 percent — another record, according to the Commerce Department. But that remains one of the lowest export levels in the world among large industrialized countries.

The outcome, paradoxically, provided both an unexpected boost to estimates of year-end economic growth and evidence of how tough it is to increase American exports in a competitive global economy while a major trading partner — Europe — is in recession.

Initial estimates from the federal government indicated that the U.S. economy shrank slightly in the last three months of 2012. Since trade deficits are treated as a drag on economic growth, the smaller-than-expected deficit in December could switch that to a slight gain, according to an analysis from Macroeconomic Advisers and other consulting firms that closely track the U.S. economy.

Still, the slow overall growth in exports was evidence of a weak world economy.

“U.S. policy can open up markets for exporters, but there is not a lot that policy can do for the state of the world economy,” said Ben Herzon, an analyst at Macroeconomic Advisers.

The large and persistent trade deficit with China and the outcome of the first months of the free-trade agreement with South Korea also prompted criticism at a time when the Obama administration is deciding how to press new trade initiatives in Asia and possibly with Europe.

United Steelworkers President Leo Gerard noted in an e-mailed statement that while the overall trade deficit dropped, the deficit in goods — manufactured products, agricultural commodities and other tradeable items — remained at a large and steady $735.7 billion.

That, he said, represents a major drain of jobs in heavy industry and other parts of the manufacturing sector.

“It’s time to recognize the damage being done,” Gerard said.

Among the trade agreements being discussed in the administration, the 11-nation Transpacific Partnership may be completed as early as October. European leaders, meanwhile, are pressing the Obama administration to open talks over a U.S.-European Union free-trade agreement.

European trade commissioner Karel De Gucht held talks this week in Washington with top Obama administration officials, and European leaders in Brussels on Friday said they would pursue “without delay” the upcoming recommendations of a U.S.-E.U. trade working group.

The administration has been hesitant to commit to formal trade talks out of concern that the cumbersome politics of the 27-
nation European Union would make a meaningful agreement difficult to achieve.

A U.S. trade official characterized the statement out of Brussels as “helpful in building confidence that the E.U. has the political will to do what is necessary for an agreement.”