Sasol, the world's biggest maker of fuel from coal and gas, was among the top gainers on the blue-chip Top-40 index, rising 10.5% to R446, boosted by a 2% rebound in the Brent crude.
Sasol benefits from a higher oil price because it sells its synthetic fuel at the same price as companies that import and refine crude oil.
Overall, investors bought everything from insurers and retailers to mining shares after the US Federal Reserve said it would take a patient approach toward raising interest rates, boosting global stock markets.
Biggest daily percentage gain
"The Fed seems to have reminded everyone that things are not so bad, maybe this is the start of the Christmas rally that everyone has been waiting for," said Sasha Naryshkine, fund manager at Vestact.
The benchmark JSE Top-40 index ended 4.8% higher at 43 609, the biggest daily percentage gain since March 2009. The broader All-share index climbed 4.25% to 49 290.
One of this year's investor favourites, Naspers [JSE:NPN] featured among the top gainers, surging 10.9% to R1 457.25, extending gains so far this year to about 31%.
Boosted by a rally in the price of gold, AngloGold Ashanti [JSE:ANG] was up 8.75% to R100 and rival Gold Fields [JSE:GFI] added 4% to R51.05.
Shares changing hands
Ellies Holdings [JSE:ELI] was one of the few stocks to fall after the maker of satellite dishes launched a deeply discounted rights issues to raise more than R100m.
Shares in the company, which have slumped by nearly 80% so far this year on worries about its financial wealth ended 2.48% lower at R1.18.
Trade was brisk, with 421 million shares changing hands, according to preliminary data from the Johannesburg Stock Exchange, more than double last year's daily average of 176 million shares.