The benchmark JSE Top40 index rose 0.41percent to 45746.93 points, while the all share index lifted 0.39percent to 52660.74 points.
Bullion shares advanced 3.98percent after a weaker dollar boosted gold prices to one-month highs, while safe haven buying further supported the commodity.
“Its a combination of a weaker dollar and a flight into safe havens because of the risk off environment in markets abroad,” said Northshore fund manager, Mark Loubser.
AngloGold Ashanti was the top gainer among gold stocks, scaling 4.34 percent to close at R155.69.
Further gains were curbed by banking stocks, which fell on news of the downgrade. The banking index slumped to more than five-month lows earlier in the day before reversing some of its losses to close down 0.1 percent.
Meanwhile, US stocks were little changed yesterday afternoon, trading in a tight range, as investors fretted over the ability of President Donald Trump to deliver on his policy plans, and ahead of his potentially tense meeting with Chinese President Xi Jinping.
The Dow Jones industrial average was up 0.23 percent at 20697.72 points.