India stretched its lead over South Africa to 143 runs in the decisive final test as Rishabh Pant made an attacking and unbeaten half-century on Thursday.

Pant was 51 not out from 60 balls and captain Virat Kohli 28 not out with him, taking India to 130-4 in its second innings at lunch on day three in Cape Town and into a position of strength in its quest to finally win a test series in South Africa.

More Images
Indian Captain Virat Kohli watches as South Africas Rassie van Der Dussen fields the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

India stretched its lead over South Africa to 143 runs in the decisive final test as Rishabh Pant made an attacking and unbeaten half-century on Thursday.

Keegan Peterson and the South African team celebrate the early wicket of Cheteshwar Pujara during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

South Africa struck twice in the first two overs of the day in a blistering start. Cheteshwar Pujara was out for 9 on the second ball of the day and to a flying catch at leg slip by Keegan Petersen.

Indian captain Virat Kohli in action during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

But it was what India needed after those early blows, and the tourists were heading toward a strong and possibly series-winning lead.

Indian captain Virat Kohli ducks a high ball while South Africas Rassie van Der Dussen watches on during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

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

Indian captain Virat Kohli watches as South African fielder Temba Bavuma narrowly misses the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian captain Virat Kohli watches as South African fielder Temba Bavuma narrowly misses the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian batsman Rishabh Pant is struck by the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian batsman Rishabh Pant is struck by the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian batsman Rishabh Pant in action during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian batsman Rishabh Pant in action during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

But it didn't come easily.

Indian Captain Virat Kohli watches as South Africas Rassie van Der Dussen fields the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian Captain Virat Kohli watches as South Africas Rassie van Der Dussen fields the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

South Africa struck twice in the first two overs of the day in a blistering start. Cheteshwar Pujara was out for 9 on the second ball of the day and to a flying catch at leg slip by Keegan Petersen.

Ajinkya Rahane followed for 1 in the next over as India, which was 57-2 overnight, suddenly found itself 58-4.

Kohli played an exceptionally cautious innings through to lunch to make sure there was no more damage, with his 28 coming off 127 balls at a strike rate of 22, an unusually defensive effort from one of the world's most talented batsmen.

Keegan Peterson and the South African team celebrate the early wicket of Cheteshwar Pujara during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Keegan Peterson and the South African team celebrate the early wicket of Cheteshwar Pujara during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

But it was what India needed after those early blows, and the tourists were heading toward a strong and possibly series-winning lead.

Kohli's caution enabled Pant to play his natural, attacking game and he hit four fours and a six to keep India scoring.

The three-test series is at 1-1 after India won the first match and South Africa hit back in the second, setting up a finale at Newlands. India, the top-ranked team in the world, is on its eighth test tour to South Africa and still trying to clinch a first series win in the country.

Indian captain Virat Kohli in action during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian captain Virat Kohli in action during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

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

Indian captain Virat Kohli ducks a high ball while South Africas Rassie van Der Dussen watches on during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian captain Virat Kohli ducks a high ball while South Africas Rassie van Der Dussen watches on during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian captain Virat Kohli watches as South African fielder Temba Bavuma narrowly misses the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian captain Virat Kohli watches as South African fielder Temba Bavuma narrowly misses the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian batsman Rishabh Pant is struck by the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian batsman Rishabh Pant is struck by the ball during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian batsman Rishabh Pant in action during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)

Indian batsman Rishabh Pant in action during the third day of the third and final test match between South Africa and India in Cape Town, South Africa, Thursday, Jan. 13, 2022. (AP PhotoHalden Krog)