Mining and police spokesmen said the tremor hit at around 1015 GMT and its epicentre is believed to be around Klerksdorp, 160km southwest of Johannesburg.
Some 3200 miners were rushed to the surface at two mines operated by South Africa's fourth largest gold producer DRDGold, but a spokesman said tunnels to 42 miners at one mine had collapsed at Stilfontein, near Klerksdorp.
"The forty-two miners are trapped 2400m underground at the number five shaft of our northwest operations," DRDGold spokesman Ilja Graulich said on Wednesday.
"We have a prototeam [rescue workers] currently trying to dig through the rockface to get to them.”
Graulich added: "Our seismic monitoring equipment picked up some four large tremors, followed by some smaller aftershocks at around 12:15 pm (1015 GMT) this afternoon."
Twenty three miners were injured by falling rock in the quake and four of them are in serious condition, with some suffering from broken bones and lacerations.
Police spokesman Louis Jacobs said at least 40 people were slightly injured in the towns of Klerksdorp and Stilfontein after the tremor struck.
"The forty-two miners are trapped 2400m underground at the number five shaft of our northwest operations. We have a prototeam [rescue workers] currently trying to dig through the rockface to get to them”
"The damage to buildings is widespread, with many of the shop windows broken," he said, adding that officials are checking all buildings for structural damage.
Klerksdorp emergency services spokesman Mesh Letanta said at least one block of flats had been evacuated due to fears that it would collapse.
Parts of the ceilings at a local shopping centre fell and children were sent home, Klerksdorp municipality spokeswoman Wendy Sokupha told the SAPA news agency.
Saunders, who works at the Council for Geoscience in Pretoria, was quoted as saying that a quake of this magnitude was "quite serious" for South Africa, a country not known for major tremors.
The quake was felt as far as the capital, Pretoria, 220km to the northeast, a lecturer at the University of Pretoria's faculty of Environmental Studies said.
"We did not hear any noise but we could feel the tremor moving through. If we could feel it here it must have been quite a major quake."
Experts said the largest earthquake to hit South Africa was in the southwestern town of Ceres in 1969 and measured 6.1 on the Richter Scale, causing widespread devastation.