The U.S. trade gap widened dramatically in July as imports surged and dealers stocked up on cars for the cash for clunkers program, while more recent data showed improvement in the U.S. labor market.

The trade gap expanded 16.3 percent to $32.0 billion, the biggest month-to-month increase since February 1999, the U.S. Commerce Department said on Thursday.

Imports leapt a record 4.7 percent on stronger U.S. appetite for foreign cars and consumer goods and on higher oil prices, which rose for a sixth consecutive month.

A separate Labor Department report showed the number of U.S. workers filing new claims for jobless benefits fell last week to 550,000 and the number of workers still collecting benefits fell to 6.088 million in the week ended August 29, the lowest since the week ended April 4.

By and large, these are signs the economy is improving despite the fact the trade deficit is widening, said Michael Woolfolk, senior currency strategist at BNY Mellon in New York.

Although the drop in jobless claims indicates a healthier labor market, we haven't seen hirings pick up yet. We might have the worst of the firings over but the companies are not confident enough in hiring, said John Canally, economist at LPL Financial in Boston.

The increase in imports shows the U.S. consumer may have turned the corner and businesses could be stocking up for the holidays, but the widening trade gap will prompt some analysts to lower their estimate of third-quarter economic growth, Canally said.

Part of the sharp drop in continued jobless insurance claims probably reflects people exhausting their benefits, said Abiel Reinhart, an economist at JP Morgan in New York.

Even so, the ultimate message (from the report) is there is repair in the labor market and we can see that because payroll losses are moderating and the unemployment rate is no longer increasing at the same pace it was, Reinhart said.

JP Morgan expects the U.S. unemployment rate to peak at 10 percent late in the year, but start falling in 2010 as payroll growth improves, Reinhart said.

Meanwhile, U.S. mortgage foreclosure filings in August hovered near July's record high despite broad efforts to keep borrowers in their homes, a report from real estate data firm RealtyTrac showed.

AUTO IMPORT SURGE

Wall Street analysts had expected the trade deficit to be little changed from June, which the Commerce Department revised to $27.5 billion from its original estimate of $27.0 billion.

U.S. imports grew for the second consecutive month, to $159.6 billion, led by a $2.4 billion increase in imports of cars and car parts and a $1.7 billion increase in consumer goods such as medical drugs, toys, clothing and televisions.

A 21.5 percent month-to-month rise in auto imports was probably due to Congress' cash for clunkers rebate program to encourage motorists to exchange old gas guzzlers for new, more fuel-efficient vehicles, analysts said.

A sixth consecutive monthly rise in the average price of imported oil, to $62.48 per barrel, also helped widen the trade gap. Petroleum product imports were the highest since December.

The trade deficit with China grew 10.8 percent in July, as imports from the Asian manufacturing giant hit their highest since November.

The July trade gap remained far below the record of $64.9 billion set in July 2008, just before the global financial crisis took a huge bite out of international trade.

U.S. exports also increased for the third consecutive month in July, to $127.6 billion, a rise of 2.2 percent from June.

We're encouraged by the signs of stabilization in the trade of U.S. goods and services represented by today's report, but we must remain diligent in our efforts to improve our competitiveness and innovation, and get American workers back on the job, U.S. Commerce Secretary Gary Locke said.

Goods exports had their best showing since December, led by increases for autos and auto parts and capital goods.

U.S. exports to Mexico were the highest since November 2008, although shipments to the European Union were the lowest since July 2006.

(Editing by James Dalgleish)