India slipped up just as it looked to be building a series-winning lead against South Africa to lose four wickets for 33 runs and go to lunch on 188-6 Wednesday in its second innings on the third day of the second test.

India's advantage was still 161 runs and anything above 200 would be difficult for South Africa to chase batting last at the Wanderers.

More Images
India's Cheteshwar Pujara at the wicket on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022 (AP Photo)

India slipped up just as it looked to be building a series-winning lead against South Africa to lose four wickets for 33 runs and go to lunch on 188-6 Wednesday in its second innings on the third day of the second test.

South African team members celebrate the wicket of India's Ajinkya Rahane on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

Ajinkya Rahane and Cheteshwar Pujara carried on where they left off the day before and both went to half-centuries.

India's Ajinkya Rahane leaves the field after his dismissal on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

At 167-5, the momentum had swung and Lungi Ngidi followed up to get a fourth wicket for South Africa in the session when he ended Ravichandran Ashwin's (16 off 14 balls) brief counterattack.

India's Ajinkya Rahane makes a shot on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

More AP cricket: https://apnews.com/hub/cricket and https://twitter.com/AP_Sports

India's Cheteshwar Pujara makes a shot on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

India's Cheteshwar Pujara makes a shot on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

But India had been totally in control of the session before a three-wicket burst by South Africa pace bowler Kagiso Rabada was crucial in the tourists faltering from 155-2.

India's Cheteshwar Pujara at the wicket on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022 (AP Photo)

India's Cheteshwar Pujara at the wicket on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022 (AP Photo)

Ajinkya Rahane and Cheteshwar Pujara carried on where they left off the day before and both went to half-centuries.

They had built a 111-run partnership when Rahane fell for 58, caught behind off Rabada.

That sparked a run of India wickets as Puajara fell two overs later for 53, also to Rabada, and the quick bowler collected a third when Rishabh Pant went for a duck.

South African team members celebrate the wicket of India's Ajinkya Rahane on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

South African team members celebrate the wicket of India's Ajinkya Rahane on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

At 167-5, the momentum had swung and Lungi Ngidi followed up to get a fourth wicket for South Africa in the session when he ended Ravichandran Ashwin's (16 off 14 balls) brief counterattack.

Hanuma Vihari, called in to the India team for this test in place of injured captain Virat Kohli, was 6 not out and the tourists' last recognized batsman left.

India is seeking a first test series win in South Africa and will make history with a win at the Wanderers after already taking a 1-0 lead in the three-match series.

India's Ajinkya Rahane leaves the field after his dismissal on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

India's Ajinkya Rahane leaves the field after his dismissal on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

More AP cricket: https://apnews.com/hub/cricket and https://twitter.com/AP_Sports

India's Ajinkya Rahane makes a shot on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

India's Ajinkya Rahane makes a shot on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

India's Cheteshwar Pujara makes a shot on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)

India's Cheteshwar Pujara makes a shot on the third day of the 2nd cricket test match between South Africa and India at the Wanderers stadium in Johannesburg, South Africa, Wednesday, Jan. 5, 2022. (AP Photo)