China's trade surplus narrowed in September for a second month in a row as growth of exports and imports both fell below forecasts, reflecting global economic weakness and offering Beijing ammunition to resist U.S. pressure on the yuan.

Exports increased 17.1 percent last month from a year ago, slowing from a 24.5 percent gain in August, and imports increased 20.9 percent, compared with August's 30.2 percent rise, the customs office said on Thursday.

That created a trade surplus of $14.5 billion in September, compared with $17.8 billion in August and $31.5 billion in July. The rolling 12-month trade surplus reached $180.3 billion in September, dipping from $182.7 billion in August.

Export growth in September was much lower than market expectations, showing the sputtering external economy, and we expect the slowing export trend to continue in the coming months, said Wang Hu, an analyst for Guotai Junan Securities in Shanghai.

Economists had expected Chinese exports to grow 20.7 percent in September and imports to rise 24.5 percent, bringing the monthly surplus to $16.3 billion.

In month-on-month terms, exports rose in September after calendar adjustment by 1.6 percent, versus a decline of 3.3 percent in August and a rise of 5.4 percent in July.

China can also point to a reduced trade surplus as evidence that it is moving to deal with economic imbalances that have riled lawmakers in the United States.

The U.S. Senate approved a controversial bill on Tuesday aimed at forcing Beijing to push the yuan higher against the dollar, which supporters argue would reduce a U.S. trade deficit with China of more than $250 billion.

Although the fate of the bill is uncertain, it has drawn sharp rebukes from Beijing. The central bank argued that a stronger yuan would not on its own reduce the bilateral trade imbalance nor save American jobs.

(Writing by Chris Buckley; Editing by Ken Wills)