* US trade gap swells to highest since October 2008
* May oil import prices jump to highest since August 2008
* U.S. imports, exports both second highest on record (Adds analyst comments, other detail)
By Doug Palmer
WASHINGTON, July 12 (Reuters) - The U.S. trade gap widened sharply in May to its highest level in nearly three years as surging oil prices helped push imports to a near record and exports fell slightly from April's all-time high.
The trade deficit totaled $50.2 billion, the highest since October 2008, and well above the consensus estimate of $44 billion from Wall Street analysts surveyed before the report, a Commerce Department report showed on Tuesday.
Despite the bigger-than-expected deficit, the high levels of exports and a pick-up of capital good imports show the struggling U.S. economy still has some signs of life.
"It still looks like foreign trade will make a positive contribution to second quarter growth, but ... maybe a half percentage point less positive. That's the bottom line -- another disappointing data point for the quarter," said Ken Mayland, president of Clearview Economics.
Imports rose 2.6 percent to $225.1 billion, the highest since the record of $231.6 billion set in July 2008 just before the global financial crisis took a huge toll on global trade.
The increase reflected record imports of businesses investing in machinery and equipment, and food, feeds and beverages in a sign of resurgent U.S. demand.
"The best news in the report from a future growth perspective is the 36.1 percent annualized growth in capital goods imports in real terms, which corroborates the stronger capital goods orders data in the durable goods report," said John Ryding and Conrad DeQuadros at RDQ Economics.
"If the economy was headed to a true double-dip, we doubt companies would be boosting their investment spending in this way," the analysts said.
The oil price rise helped push the U.S. petroleum trade deficit to the highest since October 2008. Imports from the Organization of the Petroleum Exporting Countries were also the highest since October 2008.
Oil prices declined in June and came under additional pressure when the International Energy Agency announced on June 23 a coordinated release of 60 million barrels from emergency reserves. But prices have since rebounded.
INSTANT VIEW-US trade deficit [ID:nN1E76B089]
Graphic - trade balance: r.reuters.com/caf62s
Exports put in another strong showing, but slipped 0.5 percent from the April record to $174.9 billion as shipments to the European Union, China and newly industrialized countries all fell. Exports of capital goods were the highest on record.
Weakness in the euro zone stemming Greece's debt crisis was seen as another threat to the U.S. economic recovery.
U.S. stocks were slightly lower on Tuesday on worries about the euro zone, while U.S. Treasuries rose.
TRADE TIFF IN CONGRESS
President Barack Obama in 2010 set a goal of doubling exports in five years to help fuel economic growth and bring down the U.S. unemployment rate, which is at 9.2 percent.
But a standoff with Republicans over a retraining program for workers displaced by trade has clouded prospects for congressional action on trade deals with South Korea, Colombia and Panama the White House hopes will boost exports.
The trade disputes in Congress and other economic problems caused small and medium-sized companies to be increasingly glum about a pickup in U.S. growth over the next year, according to a quarterly survey published on Tuesday by Vistage International, which represents small businesses. [ID:nN1E76A0FS]
CHINA TRADE GAP WIDENS
The politically sensitive trade gap with China jumped more than 15 percent to $25 billion. U.S. companies imported $32.8 billion of goods and services from the Asian powerhouse during May, but exported just $7.8 billion worth to that country.
In worrisome sign for U.S. exports to China in June, recent data out of Beijing shows the country's imports that month were the weakest in 20 months.
The wider trade gap with China could propel efforts in Congress to pass legislation aimed at pressuring Beijing to raise the value of its yuan currency, which critics charge is artificially weak against the dollar and gives Chinese exporters an unfair advantage.
"China's exchange rate manipulation, industrial subsidies, state-owned enterprises, and weak regulations set the stage for this mess," Scott Paul, executive director of the Alliance for American Manufacturing said, referring to huge trade gap.
"But our government's refusal to stop China's cheating has made it worse," Paul said. (Editing by Andrea Ricci and Neil Stempleman)