South Africa seized control of the first Test at Galle as Dale Steyn blew away the Sri Lankn middle order to finish the day with 5-50.
The hosts ended the day on 283-9, still 172 shy of South Africa’s 455-9 declared, as Morne Morkel dismissed Suranga Lakmal with the final ball of the day.
Sri Lanka had made a steady start to their reply, recovering from the loss of Kaushal Silva early in the day, to reach 98-1 before the Proteas pace attack, and Steyn in particular, started making inroads.
Morkel bowled Kumar Sangakkara for 24 and Mahela Jayawardene joined the left-hander back in the pavillon soon after having been trapped lbw by Steyn, leaving Sri Lanka to rebuild without their two most experienced batsmen.
Sri Lankan skipper Angelo Mathews valiantly led the fight back with an 89-run knock before being bowled by leg-spinner Imran Tahir.
Mathews, who missed scoring his third Test ton on the trot, also shared 71 runs with Rangana Herath for the eighth wicket, the highest partnership of the innings.
His effort was especially commendable since Sri Lanka's two big hitters - Jayawardene (three) and Sangakkara - failed with the bat.
Steyn struck early in the final session, removing Lahiru Thirimanne (38) with an away-moving delivery which the batsman edged behind to wicketkeeper Quinton de Kock.
The lanky fast bowler struck again soon to dismiss Dinesh Chandimal and Dilruwan Perera off his consecutive overs to cap a fiery three-wicket burst.
Chandimal (six) was caught at midwicket while Perera snicked to de Kock without opening his account.
Mathews tried to hit back, smacking Morne Morkel (2-45) for five fours in one over to race to his fifty but that was a rare show of dominance on an otherwise disappointing day for the home team.
Earlier, Tharanga, making a Test comeback after more than six years, stood out with his doughty 83-run innings that contained 14 fours and a six.
Tharanga defied the hostile fast bowling for some three hours but he was finally undone by part-time spinner Jean-Paul Duminy who had him stumped by de Kock.
Steyn tasted the first success in the morning session when he got rid of opener Silva (eight).
Silva tried to hook a bouncer from Steyn but edged it to long leg where Vernon Philander dived forward and plucked the ball inches off the ground to complete a spectacular catch.
His dismissal brought in Sangakkara, coming into the match on the back of a record seven successive fifty-plus scores.
The left-hander looked his normal poised self, pulling and driving Steyn for two fours in an over, which included his trademark cover drive. Tharanga provided solid support to his more famous partner, reaching his fourth half-century with a four off Duminy.
Tharanga dished out similar treatment to Tahir, the only specialist spinner in the South African squad, whacking him around for two boundaries is his consecutive overs.