The U.S. trade deficit narrowed sharply in September to its lowest level in seven months as exports rebounded, a tentative sign that the worst of the drag from a stronger dollar may be over. The Commerce Department said the trade gap fell 15 percent to $40.8 billion, the smallest deficit since February. Lower crude oil prices also helped to curb the import bill. The drop in the trade deficit reversed the widening seen in August, though the prior month’s figure was revised slightly down to $48 billion from the previously reported $48.3 billion. Economists had forecast the trade gap shrinking to $41.1 billion in September. When adjusted for inflation, the deficit fell to $57.2 billion in September from $63.0 billion in the prior month. Trade had a neutral impact on gross domestic product for the third quarter, which expanded at a 1.5 percent annual rate. The sharp step-down in growth from the second quarter’s brisk 3.9 percent rate mainly reflected a slow pace of inventory accumulation and ongoing spending cuts by energy firms. The dollar has gained 16.8 percent against the currencies of the United States’ main trading partners since June 2014, undercutting export growth. Lackluster global demand also has put a damper on exports. Exports in September rose 1.6 percent to $187.9 billion, with exports of services hitting a record high. There were increases in exports of capital goods and automobiles. Exports of industrial supplies and materials, however, were the lowest since October 2010. Exports to Canada, the European Union and China rose in September. Exports to Japan, however, fell 13.8 percent to their lowest level since April 2010. Imports fell 1.8 percent to $228.7 billion, the lowest level since February. They had received a boost in August from Apple’s new iPhone model. Imports of industrial supplies and materials fell to the lowest level since August 2009. Petroleum imports were the lowest since May 2004, reflecting increased domestic energy production and lower oil prices. The price of petroleum averaged $42.72 per barrel in September, down from $49.33 in August and $92.52 in September 2014. Imports from China hit a record high in September, leaving the politically sensitive U.S.-China trade deficit at an all-time high of $36.3 billion. That was up 3.8 percent from August.