Keshav Maharaj became only the second South African to take a test hat-trick as he ripped through the West Indies middle order with five wickets to help his side to an emphatic 158-run victory in the second test in Saint Lucia on Monday.

South Africa, who claimed the series 2-0 after winning the opening game by an innings and 63 runs, bowled out their hosts for 165 in pursuit of a victory target of 324 on the fourth day at the Daren Sammy Cricket Ground.

The home side were in the game at 107 for three when left-arm spinner Maharaj (5-36) claimed the scalp of Kieran Powell (51), who tried to launch him to the midwicket boundary but picked out lone fielder Anrich Nortje.

The world’s top-ranked test all-rounder Jason Holder was caught by short-leg Keegan Petersen first ball, and Wiaan Mulder took an excellent diving catch at leg-slip off Joshua Da Silva to complete the hat-trick and spark wild South African celebrations.

It was just the second test hat-trick in the country’s history, after seamer Geoff Griffin managed the feat against England at Lords in 1960.

West Indies had started the day on 15 without loss, but lost captain Kraigg Brathwaite (6) early as he edged Kagiso Rabada (3-44) to his opposing skipper Dean Elgar at first slip.

Rabada accounted for Shai Hope (2) and had Kyle Mayers (34) plumb lbw off a no-ball, but later did pick up the wicket of the attacking left-hander with Elgar catching a skier.

The teams will play a five-match Twenty20 International series starting on Saturday.