Johannesburg, Jan 4 (AP) South Africa built a big first-innings lead over Sri Lanka on Monday despite Vishwa Fernando's five wickets on Day 2 of the second test.

Fernando was key in reining in South Africa, taking 5-101 as the Proteas went from 218-1 halfway through the first session to 302 all out in their first innings soon before tea.

That was still good enough to give South Africa a first-innings lead of 145 after Sri Lanka crashed to 157 all out on the first day.

Sri Lanka had lost Kusal Perera for 1 and was 16-1 in its second innings, and still 129 runs behind at the Wanderers.

Perera's wicket was vital as he's been the one player to put pressure on the South African attack this series. He was bowled by Lungi Ngidi to spark joyous celebrations by the South African fielders.

Perera's exit meant 21 wickets had fallen inside the first two days on a Wanderers pitch playing typically tough for the batsmen.

Earlier, opener Dean Elgar made 127 and Rassie van der Dussen 67 and their partnership of 184 for South Africa looked set to push the final test, and the two-test series, well out of Sri Lanka's reach. South Africa leads the series 1-0.

But Sri Lanka, with a patched-up bowling attack after a horrendous run of injuries on this tour, pulled it back.

Fernando led that effort, although Dushmantha Chameera made the biggest breakthrough when he forced Elgar out caught in the slips straight after the first session drinks break.

Elgar's departure began a run of four wickets for 23 runs. The trend continued in the second session as Fernando completed his five-wicket haul. South Africa ultimately lost nine wickets for 84 runs as no one built on the foundation set by Elgar and van der Dussen.

Fernando's heroics aside, Sri Lanka still has an uphill task to set a competitive total and give itself a chance of saving the series. (AP)

(The above story is verified and authored by Press Trust of India (PTI) staff. PTI, India’s premier news agency, employs more than 400 journalists and 500 stringers to cover almost every district and small town in India.. The views appearing in the above post do not reflect the opinions of LatestLY)