Somerset captain James Hildreth and all-rounder Peter Trego each scored centuries as South Africa endured a challenging first day on tour at Taunton.
Hildreth made exactly 100 and Trego added a quickfire 104 - including six fours in a single Morne Morkel over - as the hosts made 312 for eight declared.
The Proteas, who saw wicketkeeper Mark Boucher head to hospital for an operation after he was struck in the eye by a bail, responded with 96 for two by the close.
Somerset's innings recovered from a faltering 32 for four as Hildreth and Trego came together to add 183 for the fifth wicket in just 23.5 overs.
Trego hit 18 fours and a six in a swashbuckling hundred, while Hildreth helped himself to 14 fours and a six. Morkel went for 90 off 14 wicketless overs and will want to forget his first, the 13th of the game.
With Somerset on 37 for four, Trego hit every ball of Morkel's over to the ropes.
The first raced through the covers, the second went straight, the third through backward-point, the fourth to third-man, the fifth through cover and the sixth wide of mid-off.
Up to then the home side had struggled against an impressive opening attack of Dale Steyn and Vernon Philander. Steyn was unlucky not to get more than one for 21 from his opening spell, but did have Alex Barrow caught behind for 11.
Philander's first five overs featured three successive maidens and cost only five runs. Direct hits from Lonwabo Tsotsobe and JP Duminy ran out Arul Suppiah and Nick Compton respectively, both for ducks, and Somerset looked in big trouble.
But Trego's assault completely transformed the day. The tourists' bowling and fielding began to suffer as Hildreth also went on the attack and the pair brought up their century stand in only 71 balls.
After they fell in relatively quick succession - Lonwabo Tsotsobe and Philander the successful bowlers - Craig Meschede took the attack on with a 67-ball half-century.
Debutant Jack Leach, a 21-year-old Taunton-born left-arm spinner, also managed 14 not out before Somerset declared.
Tsotsobe finished with three wickets after adding the scalps of Jos Buttler (14) and Chris Jones (four).
Perhaps shell-shocked by the dramatic shift in momentum, the tourists made a poor start to their reply.
Jacques Rudolph had only five to his name when he nicked Jamie Overton to wicketkeeper Barrow and his captain Graeme Smith was not far behind.
The left-hander had hit one boundary on his way to 10 before Gemaal Hussain found his edge and provided Barrow with a second catch.
Somerset could not force further breakthroughs, though, with Hashim Amla (34 not out) and Jacques Kallis (45 not out) seeing their side to stumps.
There was just one chance to part them, Kallis surviving a chance to slip on 23 off the bowling of Trego.