David Miller shone with gloves and bat as South Africa beat Sri Lanka on a super over in a dramatic first Twenty20 international at Newlands on Tuesday.

In the unaccustomed role of wicketkeeper, Miller held a catch and made a stumping as Sri Lanka were restricted to 134 for seven after being sent in.

Miller then hit 41 off 23 balls but South Africa’s lower order collapsed as the home side lost eight wickets and could only match Sri Lanka’s total.

Miller followed up with 13 runs as South Africa scored 14 off the super over, bowled by Sri Lankan captain Lasith Malinga.

Sri Lanka could only manage five runs off Imran Tahir’s over in reply.

“We didn’t handle it well with the bat in the last five or six overs but getting another opportunity in the super over I thought we handled it beautifully,” said South African captain Faf du Plessis.

Miller was handed the wicketkeeping gloves in preparation for his likely role as Quinton de Kock’s back-up in the World Cup.

He caught Niroshan Dickwella off Dale Steyn’s bowling off the second ball of the match and made a stumping when Kamindu Mendis ran past an Imran Tahir googly. Mendis top-scored for Sri Lanka with 41.

South Africa looked set for a comfortable win when Miller and Rassie van der Dussen (34) put on 66 for the fourth wicket but both were out within three balls before the rest of the batting crumbled.

Van der Dussen was caught at fine leg off Malinga and two balls later man-of-the-match Miller was run out. “It was unnecessary,” Miller admitted.

Malinga was superb in the closing overs, finishing with two for 11, while Isuru Udana bowled a tight final over, conceding only four runs.

“T20 is a different game,” said Malinga, adding that the tactic of using mainly spin bowlers worked, even though his team were not able to get across the line.

“But still, I am really happy with what we are doing,” he said.

Tahir scrambled a single to tie the match off the last ball, with wicketkeeper Dickwella missing the stumps with a throw which would have won the match for Sri Lanka.

All-rounder Andile Phehlukwayo took three for 25 as Sri Lanka were unable to recover fully after losing two wickets in the first two overs.