South Africa needs five wickets Friday to secure victory in the first Test after Sri Lanka provided dogged resistance and was 240 for five at stumps on the fourth day at St George's Park Thursday. Kusal Mendis and captain Angelo Mathews both scored half centuries as Sri Lanka, having been set a mammoth target of 488 to win, kept alive hopes of saving the Test. They need 248 to win but survival, rather than chasing the runs, had been Sri Lanka's primary objective and despite a barrage of fast bowling they stymied home hopes of wrapping up the result in four days. The opening pair of Dimuth Karunaratne and Kaushal Silva set the tone but a moment's hesitation, as they attempted a quick run, brought their 87-run partnership to an end. Karunaratne was caught short of the crease and run out for 43 to give South Africa their first breakthrough in their efforts to bowl out the visitors and take a lead in the three-match series. Kusal Perera followed two overs later when he was caught behind for six runs by wicketkeeper Quinton de Kock, edging a cut shot off the spin of Keshav Maharaj. The third wicket fell straight after tea when Silva was trapped lbw by Kagiso Rabada for 48 but Mendis displayed his emerging talent with a series of fluid strokes before an injudicious shot off Rabada saw him caught behind for 58. Dinesh Chandimal was the next to go, caught by Rabada off Maharaj for eight inside the last hour of play, leaving Mathews (58 not out) and Dhananjaya de Silva (9 not out) to see out the day. South Africa declared 50 minutes into the fourth day on 406-6 with a massive lead. They were already 432 runs ahead when they resumed on 351-5 but, with captain Faf du Plessis and De Kock approaching half-centuries, they carried on batting and accumulated runs easily, even against the new ball. The pair shared in a match-high 129-run partnership before the declaration came after De Kock was trapped leg before wicket by Rangana Herath for 69. Du Plessis remained 67 not out. South Africa, which won the toss and opted to bat, amassed 286 runs in its first innings and Sri Lanka scored 205 in reply. – Reuters