U.S. exports set a record in March, buoyed by the weak U.S. dollar and strengthening global demand as U.S. trade flows returned to levels last seen before the global financial crisis.

U.S. exports grew 4.6 percent in March to $172.7 billion, surpassing the record set in July 2008 before world trade took a sharp downturn. The March export rise was the biggest month-to-month gain in 17 years, the Commerce Department said in a report on Wednesday.

It's taken two-and-a-half years, but the level of exports has finally returned to pre-recession levels, said Paul Dales, senior U.S. economist with Capital Economics in Toronto.

Despite the big gain, the U.S. trade deficit grew to $48.2 billion in March, the widest since June 2010, as rising oil prices helped push imports nearly 5 percent higher.

Dales said he doubted the wider-than-expected trade gap in March would meaningfully worsen estimates of already weak first-quarter U.S. economic growth.

More generally, the latest surveys suggest that export growth will continue to accelerate, with the lower dollar providing further support. But the surveys suggest that imports will continue to grow at a faster rate, Dales said.

Both U.S. goods and U.S. services exports set records in March, as did two sub-categories - foods, feeds and beverages and industrial supplies. U.S. exports to Canada and South and Central America also set records and exports to the European Union were the highest since July 2008.

A weaker dollar helps U.S. exports by making them cheaper in world markets. The dollar has fallen 5.2 percent against a basket of currencies since the beginning of the year. Against the euro, the dollar has been down nearly 7 percent so far this year.

Imports grew 4.9 percent to $220.8 billion as the average price for imported oil hit $93.76 per barrel, the highest since September 2008. Oil prices continued to rise in April, but have receded in recent weeks back to early March levels.

Pierre Ellis, senior global economist at Decision Economics in New York, said the trade data could provide ammunition for members of the Federal Reserve board that want to tighten monetary policy to curb the threat of inflation.

This is a reassurance on growth, which is what the hawkish members of the Fed are looking for. This is a piece of evidence for them to consider removing accommodation before things start overheating a couple of years down the road, he said.

U.S. imports were the highest since August 2008, just as the global financial crisis was beginning to bite into trade. Imports hit a record $232.1 billion in July 2008, before tumbling sharply over the next six months.

U.S. petroleum imports were also the highest since August 2008 and the U.S. petroleum trade deficit was the widest since October 2008.

The closely watched U.S. trade deficit with China narrowed slightly in March to $18.1 billion, as U.S. exports to that country grew faster than imports from the Asian giant.

However, the trade shortfall with China for the first quarter of 2011 totaled $60.2 billion, putting it on a pace to exceed last year's record of around $273 billion.

China's own data this week showed it posted its biggest surplus in four months in April, as exports hit a record on stronger global demand.

U.S. and Chinese officials sparred over China's exchange rate policies during high-level talks this week in Washington.

The United States pressed for a faster rise in the yuan's value to help bring trade into balance, while China said it would continue exchange rate reform at its own pace.

Meanwhile, a Labor Department report showed U.S. job openings in March were the most in 2-1/2 years, pointing to a firmer tone in the labor market. Job openings rose 99,000 to 3.12 million, the highest since September 2008.

A separate industry group report showed applications for U.S. home mortgages surged last week at the fastest pace in two months as interest rates dropped for a fourth week in a row.

The Mortgage Bankers Association said its mortgage application index, which includes both refinancing and home purchase demand, jumped 8.2 percent last week. The index of loan requests for home purchases climbed 6.7 percent.

(Additional reporting by Richard Leong in New York, Editing by Andrea Ricci)