Dale Steyn broke the South Africa record for Test wickets and Duanne Olivier broke the back of the Pakistan batting to give the home team a narrow advantage on the first day of the series on Wednesday.
Steyn's one wicket of the day took him to 422 in Tests and past Shaun Pollock as South Africa's leading wicket-taker of all time.
After the significant celebrations for the 35-year-old Steyn died down, Olivier took over to return career-best figures of 6-37 as Pakistan, which opted to bat first at SuperSport Park, was bowled out for just 181 in 47 overs.
South Africa also struggled in the pace-friendly conditions of the Highveld, though, slipping to 43-4 before Temba Bavuma revived the Proteas with his 38 not out. Steyn had to help out with the bat, too, and was 13 not out as South Africa went to stumps on 127-5 — 54 runs behind with five wickets in hand.
Pakistan was into the long South African tail, though, with Bavuma the only recognized batsman left.
Fast bowler Olivier was only in South Africa's team for the series-opener after Vernon Philander and Lungi Ngidi were ruled out by injury but he was pivotal as Pakistan failed its first Test against South Africa's quicks.
Only Babar Azam provided any resistance for Pakistan with 71. He shared a 67-run partnership with Hasan Ali for the ninth wicket to save his team from a complete capitulation. Pakistan was 111-8 when those two came together.
South Africa barely needed Keshav Maharaj, using the spinner for just three overs as the three pacemen did the damage.
Rabada, South Africa's new fast-bowling star, lifted the paceman up on to his shoulders and the standing ovation in the crowd at SuperSport Park, where Steyn began his career, continued well past the on-field celebrations and was still going when he prepared to bowl his next delivery.
"I won't lie, when I was standing there at the top of my mark and everyone was standing up, I almost had a tear, I had a lump in my throat," Steyn said. "Very pleased. Very happy."
Pollock, who was commentating on television, was one of the first to congratulate him as he came off the field for the lunch break and presented Steyn with a bottle of champagne.
"On all different wickets around the world he's been absolutely superb," Pollock said, "and what those figures don't tell is he's a fantastic guy as well."
Steyn's record was a long time coming, after he sustained a career-threatening shoulder injury in 2016. He has played just four Tests in the last two years.
Steyn is up to 11th on the all-time list of Test wicket-takers, nine behind Richard Hadlee. In an indicator of his quality, his 422 wickets have come in 89 games. One of South Africa's greats, Pollock's 421 came in 108 Tests.
Pakistan's fast bowlers hit back late on the first day, which was interrupted by rain, with Mohammad Amir and Shaheen Afridi collecting two wickets each after Hasan Ali made the first breakthrough of the South Africa reply when Aiden Markram was lbw for 12.
Amir claimed the prize wicket of Hashim Amla for 8 — Amla's dip in form continued — and Afridi had captain Faf du Plessis caught at gully for a first-ball duck to put the home team in trouble at 43-4.
Bavuma and Steyn steadied, and Steyn cracked two fours in his 13 not out to end a record-breaking day with the ball with his bat doing the talking.
(With AP Inputs)