Part-time spinner Duminy removed Sri Lanka skipper Angelo Mathews (19) with the final ball of his eighth over before picking up the wickets of Nuwan Kulasekara (1) and debutant Tharindu Kaushal (0) with the first two??deliveries of his ninth.
The 30-year-old is the??eighth man to record a World Cup hat-trick, following Lasith Malinga, who has achieved the feat twice, Chetan Sharma, Saqlain Mushtaq, Chaminda Vaas, Brett Lee, Kemar Roach and Steve Finn, the latter taking his against Australia earlier in this tournament.
Duminy (3-29) and Imran Tahir (4-26) spun Sri Lanka into a stupor after Kyle Abbott, preferred to Vernon Philander, and Dale Steyn had reduced the 1996 champions to 4-2 within the first five overs following Mathews??? decision to bat.
Kumar Sangakkara (45) was in the runs again in his final ODI, the 37-year-old becoming just the sixth man to notch 500 runs in a single World Cup after Sachin Tendulkar (twice), team-mates Mahela Jayawardene and Dilshan and Australia duo Ricky Ponting and Matthew Hayden.
But Sri Lanka stumbled from 114-4 to 133 all out in 37.2 overs and South Africa chalked off their target??in 18??overs??to to win their first-ever World Cup knockout match and secure an Auckland semi-final with either New Zealand or West Indies.
Sri Lanka, therefore, will not be replicating their appearances in the previous two World Cup finals, meaning Sangakkara and Jayawardene end their one-day international careers on a sour note.
Jayawardene (4) failed with the bat in Sydney, becoming one of Tahir???s four victims, and it was left to Lahiru Thirimanne (41) to support Sangakkara, the left-hander crunching five fours in an enterprising 48-ball stint at the crease after batting at four instead of his usual opening berth.
Mathews was the only other man to make double figures for Sri Lanka, who were dealt a blow before the match when spinner Rangana Herath was ruled out having failed to recover from the finger injury his picked up against England.
Hashim Amla (16) creamed the first ball of South Africa???s innings, bowled by Malinga, through the covers for four and the Proteas eased to victory thereafter, Quinton de Kock (78 from 57 balls) top scoring.
Amla was out to a sharp catch by Kulasekara at third man but De Kock, who had scored just 53 runs in his six World Cup innings to date, and Faf??du Plessis (21), returning to the side after back trouble, guided the Proteas to a comprehensive triumph with 32 overs to spare.