WASHINGTON - The nation's trade deficit rose in April to the highest in more than a year as an improvement in exports was swamped by record levels of imported crude oil, the government reported yesterday.

The trade gap with all the OPEC nations combined was $15.7 billion. Also, the deficit with China rose sharply.

The total trade deficit - the difference between what the U.S. imports and what it sells abroad - rose 7.8 percent in April to $60.9 billion, the Commerce Department said. It was the largest imbalance since March 2007.

The latest monthly deficit was driven by a $4.3 billion increase in crude-oil imports, which jumped to a record $29.3 billion in April, as the average price during the month rose to a record $96.81 a barrel.

If the price of crude had instead been at $60 a barrel, about where it was a year ago, the trade deficit would have been $11 billion lower in April. Analysts cautioned that the deficit would widen further in coming months because oil was now trading above $130 a barrel.

U.S. export sales totaled $155.5 billion in April, up 3.3 percent, reflecting big gains in sales of U.S. commercial aircraft, farm machinery, medical equipment and computers.

But that was swamped by a 4.5 percent rise in imports, to $216.4 billion. Besides oil, there were huge gains in imports of autos and consumer goods.

The deficit through the first four months of this year is running at an annual rate of $707.5 billion, up slightly from last year's deficit of $700.3 billion, which was a 7 percent drop from 2006.

Many economists are looking for the deficit to shrink again this year, reflecting two factors - a significant economic slowdown in the United States that is cutting into demand for imports, and the weak dollar, which has helped to boost U.S. exports.

The deficit with China shot up 25.9 percent in April to $20.2 billion, reflecting higher imports of such Chinese products as toys and games, televisions, electrical appliances, and clothing.

U.S. Treasury Secretary Henry M. Paulson Jr. said in a speech yesterday that the administration intended to keep pursuing a policy of "robust engagement" with China that would include filing unfair trade cases. Officials of the two countries will meet next week, with trade a key topic.