Sri Lanka's Kusal Mendis and South Africa's Kyle Verreyne react after the former plays a shot in the Test between the sides

A spirited batting performance from Sri Lanka has set up a potentially nailbiting finish in the second Test against South Africa, in a game which could have significant ramifications for the World Test Championship race.

The pair are two of four teams still in contention for the final, with the other two teams - India and Australia - also in the midst of a crunch series. South Africa won the first Test comfortably, but the second has been much closer, swaying back and forth throughout.

South Africa posted 358 in their first innings, but looked to be facing a significant deficit as Sri Lanka built to 297-5. From there, however, they collapsed to 328 all out. It was a similar story when South Africa batted again, losing their last six wickets for 63 runs. Still, a target of 348 looked steep, especially as Sri Lanka slid to 122-5. But an unbroken 83-run sixth-wicket partnership took the score past 200, the runs required under 150, and had the tourists daring to dream again.

There have been contributions from virtually every player as well, with every frontline bowler taking at least two wickets and Tony de Zorzi the only batter on either side not to make it to 20.

A Sri Lanka win would take WTC final qualification out of South Africa’s hands. In that case, should both Sri Lanka and South Africa win all their remaining games, Sri Lanka would be on 61.54 PCT, and South Africa on 61.11 PCT, with India also able to overtake South Africa in that situation by winning all three of the remaining Border-Gavaskar Trophy Tests.

A South Africa win would all but eliminate Sri Lanka. In that case, they would either need South Africa to lose 2-0 to Pakistan, or need Australia and India to draw all three of their remaining Tests, as well as beating Australia 2-0 themselves.

Follow Wisden for all cricket updates, including live scores, match stats, quizzes and more. Stay up to date with the latest cricket news, player updates, team standings, match highlights, video analysis and live match odds.