The nation's merchandise trade deficit shrank nearly $2 billion to $10.5 billion in September as exports hit a record high, the Commerce Department said Wednesday.

The 15 percent improvement came from an August deficit revised upward from $12.18 billion to $12.3 billion. Imports declined slightly in September from the record high $39.8 billion posted the previous month, the department said.Analysts had anticipated the narrowing of the trade gap in September following a large widening in August in what has been a month-to-month seesaw pattern this year.

Including the September figures, the trade deficit the first nine months of this year is running at an annual rate of $137.2 billion, compared with a record $170.3 billion last year and $155.1 billion in 1986.

The 2.2 percent, or $700 million, September export increase to a rec-ord $28.2 billion was led almost entirely by higher sales of American autos, data processing and office equipment and chemicals, the Commerce Department said.

Sales of U.S. airplanes, telephone equipment and electrical machinery abroad declined from August.

Americans bought $600 million less in manufactured goods - including fewer apparel products and shoes plus less iron and steel - and $400 million less oil from foreign producers in September.

Altogether, U.S. imports dropped by $1.1 billion to $38.7 billion in September, the government said. But imports of foreign-made autos and auto parts climbed by 8 percent to an $8 million monthly high for the year.