South Africa tightened their grip on the second Test against West Indies as Rassie van der Dussen and Kagiso Rabada forged an unlikely sturdy batting alliance to get the tourists out of trouble.
At 73-7 in their second innings, South Africa's lead was 222, and there was the prospect of West Indies possibly chasing a target under 250 to win the game and tie the two-match series.
But Van der Dussen and Rabada combined to add 70 for the eighth wicket, with tail-ender Rabada racing to a Test-best 40, including a six off Kemar Roach. South Africa made it to 174 all out, setting a victory target of 324.
Van der Dussen finished unbeaten on 75, while in the course of the innings former West Indies captain Jason Holder became just the 15th man in Test history to reach 50 catches, 1,000 runs and 100 wickets in a career. He joined that club with a spectacular catch at second slip to see off Keshav Maharaj.
West Indies' batting fragility had been exposed by South Africa on Saturday, the second day of the match, when they were bowled out for 149, exactly half of the tourists' first-innings 298 total. It meant the hosts were on the back foot heading into day three, but they had South Africa rattled as the Proteas top order offered desperately little resistance.
The morning session was wiped out due to rain in St Lucia, but when play began at the Daren Sammy National Cricket Stadium, Roach was quick to make an impact, having openers Aiden Markram and Dean Elgar both caught cheaply at second slip by Jason Holder.
Keegan Petersen chopped Kyle Mayers' second ball of the innings into his stumps to fall for 18, and Kyle Verreynne, Quinton de Kock, Wiaan Mulder and Maharaj then contributed an aggregate 12 runs.
Medium-pacer Mayers drew edges to get rid of Verreynne and Mulder and post figures of 3-19, before Van der Dussen and Rabada set about the rescue act.
They made batting look achievable, if not always easy, with Rabada the aggressor as he cracked five fours before lashing a ball of good length from Roach over long-on for six.
That saw him go past his Test-best of 34 not out, but his innings was soon over, Roach (4-52) taking his revenge as Rabada top-edged to Darren Bravo.
West Indies trundled to 15-0 in their second innings before fading light brought an end to play, still needing 309 more runs for victory.
Rabada revives flagging South Africa
Given West Indies' form with the bat in this short series, it was hard to imagine them successfully chasing anything above 200, but had they skittled their visitors for a double-figure total the energy behind such a performance might have inspired the home batsmen.
Rabada might not have fancied bowling at a team newly imbued with confidence, and he soon set about changing the complexion of the match, slapping away the ball to the boundary with gusto, particularly when he picked the moment to go deep off Roach.
Holder joins starry list
Holder became the latest man to reach the 50 catches, 1,000 runs and 100 wickets club, Cricinfo statistics showed.
The first to that all-round haul was England's Wilfred Rhodes, while the list includes the likes of luminaries Richie Benaud, Garfield Sobers, Ian Botham, Ben Stokes, Shane Warne, Anil Kumble and Jacques Kallis.