The paceman with the low-slung round-arm action, bleach-blond hair and eyebrow ring dismissed Shaun Pollock, Andrew Hall, Jacques Kallis and Makhaya Ntini to raise his team's hopes of an incredible victory in a World Cup Super Eights match here on Wednesday.
South Africa, chasing a modest 210 to win, were cruising at 206-5 before being nearly blown away by Malinga's magic spell.
Graeme Smith's side heaved a collective sigh of relief when Robin Peterson edged Malinga past the slip for a winning four.
"I'm feeling bad because we lost the game, but I'm happy that I took a hat-trick," said Malinga, only the fifth bowler in the Cup history to achieve such a feat.
"The old ball was reverse-swinging and I got the wickets. I tried to get five-in-a-row, but unfortunately couldn't. I think we didn't have enough runs."
Other hat-trick bowlers were India paceman Chetan Sharma (v NZ in 1987), Pakistan off-spinner Saqlain Mushtaq (v Zimb in 1999), Sri Lanka paceman Chaminda Vaas (v Bangla in 2003) and Australia fast bowler Brett Lee (v Kenya in 2003).
"He's amazing. With an action like that, he still manages to keep the ball straight in line and the right length all the time. He is a magnificent bowler and I like him," said former West Indies fast bowler Colin Croft.
"He is going to surprise a lot of batsmen. He will become better and stronger in time."
Batsmen in the ongoing tournament have been finding it difficult to read the 23-year-old Malinga.
He had already taken three wickets each in his first two group matches in Trinidad against debutants Bermuda and Bangladesh before threatening to alter the course of the match against South Africa.
"That spell at the end from Malinga really tested us," South Africa captain Graeme Smith said after his team's one-wicket victory.
Malinga's action caused New Zealand's batsmen a lot of problems in a Test series in 2005.
New Zealand skipper Stephen Fleming admitted most of his batsmen found it difficult to sight the ball, which was coming virtually in front of the umpires and missing the sightscreen.
"We asked the umpires to change the colour of their trousers. There's a period there when he's delivering when it gets lost against the trousers," Fleming said.
The umpires didn't change their uniforms although West Indias official Steve Bucknor tied a sweater around his waist on the final day of the drawn first Test at Napier.
Sri Lanka coach Tom Moody said Malinga had given the team a different dimension.
"Up front, he has the ability to take wickets with the new ball. With the old ball, he is very good at executing it right up in the blockhole," said Moody.
Malinga was rated the fastest bowler at home when he made his one-day and Test debuts in 2004, but lacked consistency. He kept learning and improving with every match to eventually become a strike bowler.
He played a big role in his team's 5-0 one-day series victory in England, grabbing 13 wickets in five matches. He also impressed in the Champions Trophy in India in 2006 with his pace and control.
Malinga has so far captured 50 wickets in 32 one-dayers.
Malinga walks into history books : Sri Lanka's Lasith Malinga became the first man in international cricket to take four wickets in four balls during his side's one-wicket defeat by South Africa in the World Cup Super Eights on Wednesday.
This is how he did it:
44.5 overs: Malinga sends down his favourite slower ball and it was too good for Shaun Pollock, who plays all the way round it and is bowled for 13. South Africa 206-6
44.6 overs: This time Malinga employs a yorker and it works a treat. New batsman Andrew Hall has to dig it from under his feet but in doing so he sends the ball spiralling into the air and it is an easy catch for Upul Tharanga at cover. South Africa 206-7
Chaminda Vaas bowls the 46th over, conceding one run.
46.1 overs: Malinga grabs a sensational hat-trick by removing dangerman Jacques Kallis (86). The South African attempts a drive but appears to nick behind. He stood his ground in the face of a strong appeal but eventually Daryl Harper raises the finger. South Africa 207-8
46.2 overs: Lo and behold, Malinga makes history with fourth wicket in as many balls when tailender Makhaya Ntini hopelessly misses another yorker length delivery. South Africa 207-9
46.3 overs: He is so close to five in five and winning the match when the ball missed Charl Langeveldt's off-stump by whisker.
ThatsCricket (with inputs from AFP)