South Africa clinched a nervy two-wicket victory over Pakistan in the first Test in Centurion, booking their place in June's World Test Championship final at Lord's.

The Proteas required 121 runs for victory but had already lost three wickets when they resumed on day four, after Marco Jansen's six-wicket haul helped them bundle Pakistan out for 237 on Saturday.

Mohammad Abbas, returning to Pakistan's red-ball setup for the first time in over three years, replicated Jansen's feat by taking 6-54 as South Africa made hard work of the chase.

Abbas sent stumps flying as Aiden Markram walked for 37, then produced three more wickets in the space of three overs as South Africa collapsed from 94-4 to 99-8.

However, they found two unlikely heroes in Kagiso Rabada and Jansen, as the lower order held up to put them within touching distance of the World Test crown.

Rabada crashed an unbeaten 31 from 26 balls in his 51-run partnership with Jansen (16*), who fittingly slammed the decisive four off Abbas' bowling to cap his dream performance across the Test.

Data Debrief: Proteas get shot at glory

South Africa will now have the chance to become the third ICC World Test Championship victors, after New Zealand won the 2019-21 edition and Australia triumphed in 2021-23.

They have already clinched their best finish in the competition, having been third in the last edition, and will face either Australia or India in the showpiece match.

They had their lower order to thank as Abbas' career-best red-ball innings went to waste. He had previously scalped five wickets on four occasions, with two of those coming in the same match against Australia in October 2018.

The second and final Test in the series will begin on January 3 at Newlands Cricket Ground in Cape Town.