The 24-year-old smashed a 64-ball 116 not out as England chased down a challenging 190-run target in 19.2 overs.
With England needing 23 off the last two overs Hales smashed Nuwan Kulasekara for a six to reach his hundred off 60 balls and then hit Angelo Mathews for the winning six, to anchor England's best chase in all T20 cricket.
Hales hit six sixes and 11 boundaries in a breathtaking display of batting.
The victory gives England their first win in two games while Sri Lanka lost their first in three to leave Group One wide open with South Africa beating the Netherlands by six runs earlier in the day for their second win in three matches.
New Zealand have one win in two matches.
England were rocked by Kulasekara (4-32) in the first over when he bowled Michael Lumb off the fifth ball and had Moeen Ali caught in the slips off the last to leave England reeling at 0-2.
But Hales and Eoin Morgan took the attack to the Sri Lankan bowlers, as Hales smashed three sixes and a four off Ajantha Mendis.
Mendis went for 52 runs in his four overs as spinners found the ball hard to grip because of the excessive dew.
Morgan was finally dismissed by Kulasekara with 38 needed for victory.
The previous best third wicket stand in all T20s was 137 set by thed New Zealand pair of Martin Guptill and Kane Williamson against Zimbabwe at Auckland in 2012.
Sri Lanka's total was built around 89 by Mahela Jayawardene and 55 by Tillakaratne Dilshan.
Jayawardene hit 11 boundaries and three sixes during his 51-ball knock and Dilshan smashed two sixes and four fours in his 47-ball innings as the two added 145 for the second wicket.
Jayawardene was lucky not to be out off the first ball he faced when television replays showed Lumb took a brilliant catch off Jade Dernbach.
But the on-field umpires -- Rod Tucker at the non-striker's end and Aleem Dar of Pakistan -- referred the catch to television umpire Steve Davis.
Davis, also from Australia, ruled replays were inconclusive.
That did not end England's misery as their fielders dropped as many as four catches, twice off Jayawardene on five and 82, and one off Dilshan on 21 and in the final over off Thisara Perera who made 23 not out.
England dismissed opener Kusal Perera for three in the second over.
Jayawardene smashed James Tredwell for his eighth boundary to complete his ninth half-century off just 32 balls.
He was finally bowled by Chris Jordan. Both Jordan and Dernbach picked up two wickets apiece.
Australia take on defending champions the West Indies and India face Bangladesh in Group Two in Dhaka on Friday.
Top two teams from each group will qualify for the semi-finals. The final will be played in Dhaka on April 6.