Eoin Morgan produced a century of consummate class to prevent England slipping to a first ever defeat against Bangladesh and clinch the one-day international series in the process.
Bangladesh had apparently bowled themselves into a winning position as they sought a full set of scalps among the Test-playing nations but Morgan, who made a masterful 110 not out, smashed 16 off the penultimate over to guide England over the line by two wickets.
The Dublin-born batsman did not even celebrate his hundred, only betraying emotion after sealing victory with a mighty six off Shafiul Islam.
A raucous home crowd were stunned into silence by Morgan's heroics after it seemed the excellent Shakib Al Hasan had bowled them to the point of triumph.
Bangladesh got off to the perfect start when Shafiul dismissed Craig Kieswetter with the third ball of the reply.
After Alastair Cook nabbed a quick single, Kieswetter edged his first ball past the keeper for four before feeding Imrul Kayes at first slip.
Cook clipped a first four through the covers off Rubel Hossain and there were two more in the fourth over, one flicked fine by Kevin Pietersen and another driven square by the captain.
He hit three boundaries off Shafiul's next over but was fortunate not to be caught from the second, Mahmudullah misjudging the flight and seeing the ball drift over his head.
The noise levels spiked when Pietersen fell for 18 in the 10th over, leg before to one that straightened from slow left-armer Abdur Razzak.
Razzak had Paul Collingwood dropped on two but had his man lbw on the sweep moments later.
Morgan was next up and was quickly working the singles until Shakib returned to bowl a fine maiden to the Dubliner.
Cook passed 50 in 52 balls and heaved six more off Mahmudullah to push England past three figures.
But the 25-year-old was out for 60 in Shakib's next visit, caught, albeit clumsily, at the wicket by Mushfiqur Rahim.
Morgan and Matt Prior survived big lbw shouts and were made to dig deep for their runs as the spin barrage continued.
Morgan was the busier of the batsmen and pulled Shafiul into the stands to relieve some of the tension in the 33rd over, moving into the 40s in the process.
Prior hit another welcome boundary before drinks, reverse-sweeping cutely off Naeem Islam.
Prior (42) had started to look confident but, with the score on 198, he became Razzak's third lbw victim.
With 10 overs remaining, England required 61.
They had 23 of them when Luke Wright (seven) was needlessly bowled by Shakib looking for a six.
Only one more was added before Mahmudullah sent Tim Bresnan back for a duck to put the Tigers firmly in the ascendancy.
The batting powerplay was automatically enforced for the final five overs with 35 still needed.
Shakib clean bowled Graeme Swann for two in the 46th, celebrating riotously as the stumps shattered.
Sixteen were then needed off 12 balls and with batting support dwindling, but Morgan brushed aside the pressure to hit two fours and a big six to win it with seven balls to spare.
The Tigers had earlier impressed with a composed performance in the first innings.
There were fewer fireworks than in the 228 all out they made in Sunday's opener but a more mature outlook yielded the right results.
Tamim Iqbal, whose 125 lit up that match, was the man most likely to break the shackles but he fell to Stuart Broad for 30.
Aftab Ahmed, promoted to number three after Zunaed Siddique was dropped, lasted a mere five balls before losing his off stump to Bresnan.
At the other end Kayes was dropping anchor for an innings of impressive concentration but few big blows.
When he did try to clear the ropes he was deceived by Swann's dip and turn and thereafter settled into an innings of gentle accumulation.
In all he made 63 in 113 deliveries before Collingwood reacted quickly to catch a flat chance off Swann. He had put on a stand of 90 alongside Mushfiqur, who then put on 45 for the fifth wicket with Mahmudullah (27).
Like Kayes, Mushfiqur looked to manipulate rather than mow the ball, though his run-rate was more impressive.
When he finally became the second of Bresnan's three victims, he had compiled 76 from 88 balls, with just 20 coming in boundaries.
Naeem (18 not out) and debutant Suhrawadi Suvo (14no) struck cleanly as the final five overs yielded 45, Suvo cracking Wright for the first six of the day at the death.