Spinners Nauman Ali and Yasir Shah shared nine wickets to dismiss South Africa for 245 in the second innings and set up a small target of 88 runs for Pakistan to win the first test.

Nauman, a 34-year-old left-arm spinner making his test debut, returned 5-35 and Shah took 4-79 to bowl out South Africa a half-hour before lunch on day four.

Pakistan's openers had reduced the target to 66 and went to the break at 22-0. Imran Butt was not out on 12 and Abid Ali was unbeaten on 10.

Pakistan's spinner Nauman Ali, left, celebrates after taking the wicket of South Africa's George Linde (27) during the fourth day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Friday, Jan. 29, 2021. (AP PhotoAnjum Naveed)

Pakistan's spinner Nauman Ali, left, celebrates after taking the wicket of South Africa's George Linde (27) during the fourth day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Friday, Jan. 29, 2021. (AP PhotoAnjum Naveed)

Pakistan has been in control since taking a 158-run first-innings lead, when its lower order rallied from 27-4 to reach 378, helped by Fawad Alam's gritty century.

South Africa resumed Friday on 187-4 and things immediately got worse for the tourists when fast bowler Hasan Ali bowled night-watchman Keshav Maharaj with the first delivery of day four.

Captain Quinton de Kock, who fell to a reckless shot in South Africa’s first innings of 220, failed for the second time against the spinners. The tourists were just 34 runs ahead when de Kock offered a regulation catch in Shah’s second over to give Abid Ali his third catch in the innings.

Pakistan's spinner Yasir Shah, second from right, and teammates celebrate after the dismissal of South Africa's Quinton de Kock (12) during the fourth day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Friday, Jan. 29, 2021. (AP PhotoAnjum Naveed)4

Pakistan's spinner Yasir Shah, second from right, and teammates celebrate after the dismissal of South Africa's Quinton de Kock (12) during the fourth day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Friday, Jan. 29, 2021. (AP PhotoAnjum Naveed)4

Nauman then got into the act by having George Linde (11) caught at leg slip. Nauman wrapped up the innings by claiming the last three wickets off his successive overs.

Temba Bavuma resisted for nearly two hours to score 40 off 93 balls before he was the last man to get dismissed when he attempted a sweep against Nauman and was adjudged lbw.

South Africa struggled against the spinners on the fourth day pitch, adding just 58 runs for the loss of six wickets as Nauman became the oldest Pakistani spinner to take a five-wicket haul in an innings on test debut.

South Africa's Keshav Maharaj, left, walks back to pavilion while Pakistan's pacer Hasan Ali, 32 celebrates with teammates after his dismissal during the fourth day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Friday, Jan. 29, 2021. (AP PhotoAnjum Naveed)

South Africa's Keshav Maharaj, left, walks back to pavilion while Pakistan's pacer Hasan Ali, 32 celebrates with teammates after his dismissal during the fourth day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Friday, Jan. 29, 2021. (AP PhotoAnjum Naveed)

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

Pakistan's spinner Nauman Ali bowls during the fourth day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Friday, Jan. 29, 2021. (AP PhotoAnjum Naveed)

Pakistan's spinner Nauman Ali bowls during the fourth day of the first cricket test match between Pakistan and South Africa at the National Stadium, in Karachi, Pakistan, Friday, Jan. 29, 2021. (AP PhotoAnjum Naveed)