At 1545 GMT, the rand traded at 16.6125 against the dollar, 0.76% weaker than its previous close.

Data from the South African Revenue Service showed that the trade surplus narrowed to 24.23 billion rand ($1.46 billion) in June from a surplus of 30.85 billion rand in May.

Market expectations were for a trade surplus of 25.5 billion rand.

Investec analyst Annabel Bishop said in a research note that the country's terms of trade, which dropped over the first half of the year, added to rand weakness.

The June budget surplus rose to 73.84 billion rand from 63.15 billion rand a year earlier, National Treasury data showed.

On the stock market, the Top-40 index and the broader all-share rose almost 0.5%, driven mostly by mining sector shares.

The government's benchmark 2030 bond rose, with the yield down 6.5 basis points to 10.360%.

($1 = 16.6408 rand)

(Reporting by Bhargav Acharya in Bengaluru and Anait Miridzhanian in Gdansk; Editing by Kim Coghill and Ken Ferris)