Lasith Malinga took a record third hat-trick as Sri Lanka secured a consolation four-wicket victory over Australia in the fifth and final one-day international on Monday.

Malinga removed Mitchell Johnson, John Hastings and Xavier Doherty to become the first bowler to take three hat-tricks in one-dayers as Sri Lanka dismissed Australia for 211 before achieving the target with three overs to spare.

Paceman James Pattinson and left-arm spinner Doherty bagged two wickets each for Australia, who clinched the series 3-2.

Australia, who had an unbeatable 3-1 lead before the match, were comfortably placed at 210-5 before losing their last five wickets for just one run, with Malinga doing the maximum damage to finish with 3-35 off eight overs.

Malinga, known for bowling accurate yorkers with a slinging action, had earlier taken hat-tricks in two World Cups -- against South Africa in 2007 and Kenya in 2011.

Sri Lanka's batsmen stuttered to 33-3 at the start of their innings with Pattinson taking two wickets in his opening spell, but Mahela Jayawardene (71) and Chamara Silva (63) put on 111 for the fourth wicket to prop up the innings.

Silva, who hit one six and eight fours in his 71-ball knock, was dismissed just before rain stopped play but Jayawardene and Angelo Mathews (26) ensured win when the game resumed with a 51-run stand for the fifth wicket.

Opener Shane Watson top-scored for Australia with an 84-ball 56, which contained one six and six fours. Skipper Michael Clarke (47), David Hussey (46) and Ricky Ponting (31) were the other main scorers.

Australia lost opener Shaun Marsh in the second over after being put in to bat, but Watson steadied the innings with two useful stands.

Watson added 67 for the second wicket with Ponting and 56 for the next with Clarke before falling in the 28th over, caught at deep mid-wicket off Mendis.

Clarke looked set to complete his third half-century of the series before being caught behind off Eranga.