David Miller and Kagiso Rabada combined to propel South Africa to a thrilling victory as they edged Sri Lanka by four wickets despite a hat-trick by Wanindu Hasaranga in the T20 World Cup on Saturday.

With South Africa needing 15 off the final over, Miller smashed two sixes and struck the winning boundary as South Africa reached their target of 143 with one ball to spare in Sharjah.

T20 World Cup, SA vs SL as it happened: David Miller powers South Africa to 4-wicket win

Miller finished with 23 off 13 balls while Rabada made 13 off seven to carry their team home after Hasaranga took the third hat-trick in tournament history.

Hasaranga’s figures of 3-20 were not enough for Sri Lanka who made 142 in their innings.

His triple strike was spread over the final ball of his third over and first two of his fourth and pushed South Africa to a precarious 112-6 with his second victim, skipper Temba Bavuma, out for 46.

The left-handed pair of Miller and Rabada then smashed 34 runs between them to give South Africa their second straight win in the Super 12 stage.

Earlier Sri Lanka’s Pathum Nissanka hit 72 but South Africa bowled out their opponents for 142 in a match that began with Quinton de Kock taking the knee.

Tabraiz Shamsi returned figures of 3-17 from his four overs of leg spin and fast bowler Dwaine Pretorius also took three wickets after South Africa elected to field first.

De Kock returned to the South Africa starting lineup after missing the previous match to take up the wicketkeeping duties.

He knelt down in support of the anti-racism gesture along with the rest of the Proteas team.