CAPE TOWN, JANUARY 4

India beat South Africa by seven wickets in the shortest test match in cricket history on Thursday.

India crossed the finish line 12 overs after lunch on day two. Chasing 79, it scored 80-3.

Only 642 legitimate deliveries were bowled across four-plus sessions. The previous shortest test - 656 balls- was in 1932 at Melbourne between Australia and South Africa.

India's first win at Newlands tied the two-match series 1-1. South Africa won in Centurion by an innings and 32 runs.

"This win is a great feat for us," captain Rohit Sharma said. "We had to learn from our mistakes in Centurion. We came back very well, especially our bowlers. We knew it was going to be a short game where every run mattered. We applied ourselves with the bat and got nearly a 100-run lead."

Fast bowler Jasprit Bumrah's 6-61 helped to negate Aiden Markram's brilliant 106 to bowl out South Africa out for 176 runs in its second innings by lunch.

That gave India a tricky chase of 79 on a pitch of variable bounce.

Opener Yashasvi Jaiswal scored a quickfire 28 off 23 balls, with six boundaries. He was caught at long leg off Nandre Burger.

Sharma survived two dropped catches, and was unbeaten in the end with 17 not out.

Kagiso Rabada bowled Shubman Gill for 10, and finished the short series with 11 wickets.

Marco Jansen nicked off Virat Kohli for 12 runs when India was four runs from only its fifth win on South African soil.

Earlier, Markram's counterattacking century helped the Proteas improve from 111-7 to finish on 176, when lunch was called.

After 23 wickets fell on an extraordinary first day, South Africa resumed on 62-3 in its second innings and was immediately in more trouble when David Bedingham was caught behind for 11 off Bumrah.

Kyle Verreynne scored 9 and pulled to mid-on four overs later, again off Bumrah.

Jansen was out caught, a return catch to Bumrah, then Keshav Maharaj was caught at gully.

Bumrah earned his ninth five-wicket haul in test cricket and South Africa was down to 111-7 in 25.2 overs.

The game looked like ending in the morning session with India chasing an innings victory. But Markram stepped up.

The opener scored 51 off 38 balls with tailender Rabada for the eighth wicket, and reached his hundred off 99 balls. Markram hit 17 fours and two sixes in his 103-ball knock.

The next highest score was Dean Elgar's 12. Apart from Markram, only three batters reached double digits.

Before Markram's masterclass, the best individual score in the game was Kohli's 46 in India's first innings.

Markram was caught off Mohammed Siraj, who picked up his first wicket of the second innings after taking 6-15 in the first innings.

Prasidh Krishna also claimed his maiden test wicket after another poor outing in his debut series.

Bumrah wrapped up South Africa's innings before lunch when Lungi Ngidi was caught at slip for 8. It was his third six-wicket haul in test cricket.

He finished the series with 12 wickets and was named joint player of the series with Elgar, who scored 201 runs across four innings.

Elgar, who led South Africa at Newlands in the absence of the injured Temba Bavuma, announced his retirement pre-series.

"I would have liked to do more in this test, but I am still proud of my performance in Centurion," said Elgar, who scored 185 in the first innings there.

"These were some really tough conditions. The first innings killed us with the bat. India bowled very well and used the conditions perfectly. A three-test series would have been fantastic."