At 1545 GMT, the rand traded at 15.0425 against the dollar, around 1% firmer than its previous close.

Data from the revenue service showed the trade surplus widened to 42.4 billion rand ($2.8 billion) in August, versus economists' predictions for a 39.0 billion rand surplus.

Bumper commodities prices especially for precious metals, a key South African export, have bolstered the country's terms of trade this year and supported the rand.

August private sector credit rose 1.1% year on year in August, central bank data showed, also more than expected and suggesting loan demand is recovering.

The dollar was more than 0.1% weaker against a basket of currencies, pressured by a rise in U.S. weekly jobless claims and as investors consolidated gains after a steep rise the last few sessions.

Johannesburg-listed stocks dipped, closing the day with the biggest monthly decline since the March 2020 crash as worries around China's growth and crackdown on technology firms, coupled with stimulus withdrawal signals from the U.S. dented sentiment.

The benchmark all-share index dropped 0.13% to 64,282 points, closing the third quarter of the year with a monthly decline of 4.96%.

The blue-chip index of top 40 companies was down 0.27% to 57,863 points.

South African mining firms and technology investor Naspers Ltd, which indirectly holds around 30% stake in Chinese company Tencent, are among the major companies that pulled the indexes down this month.

Investors have said that a bull run in the local market is over as commodity prices have started to decline, but with companies having repaired their balance sheets, a major crash is also unlikely.

In fixed income, the yield on the benchmark 2030 government bond dropped 4.5 basis points to 9.225%, reflecting a stronger price.

(Reporting by Alexander Winning and Promit Mukherjee; Editing by Cynthia Osterman)