South Africa started off confidently after Pakistan's lower order increased the first-innings lead to 158 runs on the third day of the first cricket test.

No. 11 Yasir Shah made better than a run-a-ball 38 and shared a 55-run last-wicket stand with Nauman Ali (24) before Pakistan was bowled out for 378 inside the first hour of the morning session Thursday.

Dean Elgar, who scored a half century in South Africa first innings score of 220, was not out on 18 and Aiden Markram was unbeaten on 16 as South Africa reduced the margin to 121 and reached 37-0 at lunch.

Pakistan's Nauman Ali follows the ball after playing a shot during the third day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Thursday, Jan. 28, 2021. (AP PhotoAnjum Naveed)

Pakistan's Nauman Ali follows the ball after playing a shot during the third day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Thursday, Jan. 28, 2021. (AP PhotoAnjum Naveed)

Markram and Elgar began with attractive boundaries against Pakistan's fast bowlers on a wicket which has eased out considerably for batsmen after 14 wickets fell on the first day.

Pakistan recovered from a precarious 33-4 on day one to post a commendable total on the back of Fawad Alam’s patient century and useful contributions from lower order.

Kagiso Rabada’s 200th test wicket was the highlight for South Africa after Pakistan resumed on day three at 308-8 as Shah added runs at a brisk pace.

Pakistan's Yasir Shah bats during the third day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Thursday, Jan. 28, 2021. (AP PhotoAnjum Naveed)

Pakistan's Yasir Shah bats during the third day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Thursday, Jan. 28, 2021. (AP PhotoAnjum Naveed)

Rabada reached the milestone in his first over of the day when he uprooted Hasan Ali’s (21) middle stump as the batsman attempted a reckless pull.

The 25-year-old fast bowler, playing his 44th test, became the youngest South African to complete 200 test wickets. He finished the innings with figures of 3-70.

Shah ensured Pakistan stretch its lead beyond the 150-run mark by smashing four boundaries and also lofting Keshav Maharaj (3-90) over long on for a six before the left-arm spinner ended South Africa’s woes by having Nauman trapped lbw.

South Africa's Kagiso Rabada appeals un successful LBW out of Pakistan's Nauman Ali during the third day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Thursday, Jan. 28, 2021. (AP PhotoAnjum Naveed)

South Africa's Kagiso Rabada appeals un successful LBW out of Pakistan's Nauman Ali during the third day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Thursday, Jan. 28, 2021. (AP PhotoAnjum Naveed)

Lungi Ngidi took 2-57 but fast bowler Andrich Nortje returned with expensive figures of 2-105.

More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports