The benchmark JSE Top40 index rose 0.72 percent to 46757.54 points. The all share index added 0.74 percent to 53535.16 points.
Investors were seeking assets considered havens from risk amid mounting political and security concerns over North Korea, the Middle East and an imminent French election.
Harmony Gold leapt 7.1 percent to R37.87, making it the biggest gainer on the bourse. Anglo American Platinum advanced 5.52 percent to R371.85 and Gold Fields was up 3.23 percent to close at R52.35.
Meanwhile, US stocks came off session lows yesterday afternoon, but the Standard & Poor’s 500 (S&P 500) was still on track for its worst day in three weeks amid mounting geopolitical tensions.
The White House said President Donald Trump was open to authorising additional strikes on Syria if its government used chemical weapons again or deploys barrel bombs.
At 6.27pm, the Dow Jones industrial average was down 0.23 percent at 20610.91 points, the S&P 500 was down 0.42 percent at 2347.28 points and the Nasdaq Composite was down 0.48 percent at 5852.44 points.