Lara put left-arm spinner Robin Peterson to the sword in the penultimate over of the day, driving him for four, six, six, four and four and then cutting the last ball for four.
The previous record was 26 conceded by Younis Khan of Pakistan against New Zealand's Craig McMillan in 2000-01 in a Test in Hamilton. McMillan hit five fours and a six.
In non-Test match play, the record is a maximum 36, achieved for the first time and most notably by Gary Sobers when he hit Glamorgan spinner Malcolm Nash for six sixes in an English county game at Swansea in 1968.
At stumps on Sunday, Lara was unbeaten on 178 with the West Indies on 363 for six in reply to South Africa's first innings of 561, still 198 runs in arrears.
Lara, the West Indies captain, has been at the wicket for six hours, facing 239 balls and hitting 28 fours and two sixes. It is his 23rd Test century.
Peterson reflected of his mauling: "Hopefully I'll learn from it and be a better bowler as a result."
Lara said: "I had no intention of going for it. I just wanted to get as many runs as possible."
The skipper and Shivnarine Chanderpaul, who made 34, shared a stand of 125 for the fourth wicket that stemmed the tide after South Africa's bowlers delivered a hostile morning session.
The West Indies had resumed on 87 for one and lost Ramnaresh Sarwan for 21 in the sixth over to end a stand of 51
CAUGHT BEHIND
Sarwan was caught behind by wicketkeeper Mark Boucher off an excellent ball from fast bowler Shaun Pollock that pitched on off-stump and tracked away from the right-hander.
Lara flashed repeatedly outside his off stump in his first 50 and almost paid the penalty when on 15 he edged a ball from Makhaya Ntini to Pollock at slip.
Pollock juggled the ball several times before it eventually fell to earth.
The West Indies were able to score just 51 runs before lunch and the home side's hard work paid dividends five balls after the break when Ganga was hurried into a hook shot by Pollock and skied a catch to Peterson at midwicket. Ganga had batted over four hours for his 60.
Chanderpaul played on to a delivery from Ntini and the same bowler made it 278 for five when he had Ridley Jacobs caught behind by Boucher for four.
Vasbert Drakes scored 21 before being trapped in front by Jacques Kallis and Mervyn Dillon was six not out at the close.
Lara's name is synonymous with great batting feats and he still holds the record for the highest individual score in first-class cricket which he set in 1994 when hitting 501 not out for Warwickshire against Durham.