Sri Lanka's tour of Australia finished in ugly scenes as players clashed on field and had to be physically separated.
Monday night's defeat means Australia lost the series two-nil and remain seventh on the world rankings.
Sri Lanka scored 4-161 and Australia reached 2-60 from 10 overs before a 45-minute rain delay.
Australia resumed with a revised target of 122 from 15 overs and finished on 3-119.
Skipper George Bailey hit 45 and Shaun Marsh was unbeaten on 47, while Glenn Maxwell hit his first two deliveries for four and needed another boundary from the final delivery to clinch victory.
Maxwell (eight not out) missed the final ball and ran a bye as Australia finished three shy of victory.
Before the final ball, Sri Lanka's fielders had gathered around the bowler Thisara Perera to offer advice and an angry Maxwell yelled at the tourists to get on with it.
This prompted Sri Lanka's Mahela Jayawardene to yell back at Maxwell and the pair clashed immediately after the final over in a nose-to-nose argument while Perera taunted Maxwell.
Several Australia players also argued with Jayawardene during the on-field handshakes in front of 39,247 fans.
Needing 18 from the final over with eight wickets in hand, Australia scored 14 off the first five balls including two successive fours from Maxwell after George Bailey's exit caught at deep-square leg.
Bailey suffered a foot injury while batting and could be in doubt for Friday's first one-day international against West Indies in Perth.
Earlier, Jayawardene (61 not out) shared a 63-run partnership with Jeevan Mendis (25) for Sri Lanka's fourth wicket before plundering 20 runs from the final over with Thisara Perera.
Perera belted an unbeaten 35 from 15 deliveries.
Jayawardene and Perera added 59 from 28 deliveries.
Offspinner Maxwell (1-23 from four overs) and paceman James Faulkner (1-24) were able to restrict Sri Lanka's scoring.
However Ben Laughlin's final over, which went for 20 runs including one bye, blew out his figures to 1-40 and fellow quick Mitchell Starc (0-35) also struggled.
Australia have not won a T20 series since February 2010.
- With AAP