Pakistan captain Shan Masood hit an unbeaten century in an opening-wicket stand of 205 alongside Babar Azam (81) to lead a fightback on the third day of their Test against South Africa, having earlier been forced into a follow-on on Sunday.

The visitors had been skittled earlier in the day for just 194, which left them 421 behind South Africa's first-innings score of 615.

Resuming at the crease on 64-3, Pakistan were under the pump for the early part of the day. Babar (52) and Mohammed Rizwan (46) collectively chipped away at the total, putting on a stand of 98 before the former was caught by Kyle Verreynne.

Aside from Babar and Rizwan, nobody scored more than 19 in Pakistan's first innings, which capitulated with the fall of six wickets for just 76 runs either side of lunch.

Things got better for Pakistan in the second innings, when they made South Africa's bowlers suffer on a surface that remains in good nick for batters.

Kagiso Rabada and Marco Jansen fashioned just one chance between them, with the former finding Masood's edge with the captain on 18, though the ball flew through the third slip position.

South Africa's only wicket of the second innings came when Babar edged a full Jansen delivery to slip. Nightwatcher Khurram Shahzad came in to see out the day, with Pakistan trailing by 208 at stumps with nine wickets remaining.

Data debrief: Masood leads Pakistan fightback

Masood could not have picked a better time to find form, with his century the first time he had gone beyond 30 runs in nine innings.

It was also his sixth Test century, while he is the first Pakistan captain to hit a Test century in South Africa.

Babar and Masood, meanwhile, are the first Asian openers to have had a 200+ partnership in South Africa.