Johannesburg - The All Share [JSE:J203] index topped 40 000 for the first time in its more than 17-year history on Wednesday, rising more than 2% after the US fiscal deal sparked a global equity rally.
The long-awaited deal to avoid a fiscal crisis in the world's top economy sent shares and commodities sharply higher around the world, with diversified miners such as Anglo American and Exxaro Resources clocking up hefty gains.
"People are trading on the momentum of the story and not fundamental values of stocks," said Michael Carlsson, a trader at Johannesburg broker Consilium Securities.
The All share surged 2.07% to finish at 40 061.75, its highest finish since the index was launched in mid-1995.
The benchmark Top 40 - (Tradeable) [JSE:J200] also booked a record close, jumping 2.4% to 35 630.85, its largest one day jump in a year.
Stocks ended 2012 near record highs with a 22% surge that marked their best annual return since 2009.
While retail and industrial stocks cashed in last year, resource shares like Anglo American and BHP Billiton are poised for early gains in 2013.
"A lot of the shares have not really done well and are lagging way behind where they were a few months ago. These shares, particularly in resources, are playing a bit of catch up," said Carlsson.
Shares of Anglo American [JSE:AHL] climbed almost 7% to R277.42 while larger rival BHP Billiton [JSE:BIL]
gained close to 5% to R307.49.
Miners were also helped by higher commodities prices and expectations the US deal could help underpin demand for commodities.
Gold stocks also benefited with AngloGold Ashanti [JSE:ANG]
adding almost 3% to R270.54 and Gold Fields [JSE:GFI]
ending 2.5% up at R106.39.
The precious metal hit a two-week peak during the session with spot gold up 1% at $1 690.29. Gold ended up around 7% in 2012, the twelfth straight year of gains. Trade was thin in the session, with just 99.7m shares changing hands according to preliminary exchange data. Advancers outnumbered decliners, 193 to 89.
Follow Fin24 on Twitter, Facebook, Google+ and Pinterest.