Bangladesh turned a batting collapse into a Champions Trophy thriller, chasing a target of 266 to defeat New Zealand by five wickets with 16 balls to spare in Cardiff.
The result ousts the Black Caps from the tournament after their middle to lower order batting again stumbled in the death overs.
Bangladesh had never beaten New Zealand in six previous ODIs at international tournaments.
Mahmudullah and Shakib Al Hasan came together at 33 for four in the 12th over. They sculpted the highest Bangladesh one-day international partnership for any wicket against all countries, contributing 224 runs from 209 balls.
The pair delivered a lesson in absorbing pressure and building momentum. Shakib made his seventh ODI century, 114 off 115 balls, and Mahmudullah his third with 102 not out off 107.
The last time Bangladesh's top four scored fewer runs in an ODI was in 2011. Tim Southee produced movement reminiscent of John Travolta in Saturday Night Fever to take a wicket in each of his first three overs. He finished with three for 45 from nine overs but took three for 26 from his first spell of seven. He secured the lbws of Tamim Iqbal and Soumya Sarkar, and had Sabbir Rahman nicking behind. Adam Milne backed up by bowling Mushfiqur Rahim.
That did not faze Bangladesh's Nos 5 and 6 who refused to smell any fear. Buoyed by a vocal crowd the left-hand/right-hand combination kept the New Zealanders on alert throughout. The partnership hallmark was pushing the ball into gaps to generate a supply of singles that Tinder would be proud of.
They needed 97 from the last 15 overs and the required rate dropped below a run-a-ball with 7.1 overs to go. The denouement became inevitable.
The disappointment from a New Zealand perspective was that Kane Williamson and Ross Taylor laid another perfect batting platform. The déjà vu of a tepid middle order display offered Bangladesh the chance of survival.
When Williamson was run out for 57 off 69 balls in a mix-up with Taylor at the end of the 30th over, New Zealand had eased to 152 for three after opting to bat.
Rubel Hossain and the recalled Taskin Ahmed challenged the New Zealand captain at times, but he added to scores of 100 and 87 in the tournament.
Taylor eventually posted 63 off 82 on a green-tinged pitch before mistiming a flick to short fine leg off Taskin.
New Zealand were 201 for four in the 39th over.
The hiccups came when Mosaddek Hossain began his second over, the 44th of the innings.
The 21-year-old off-spinner dismissed Neil Broom for 36 off 40 balls from his first delivery. The New Zealand No.5 skewed a leading edge behind point, as he swung for the legside. A single to Jimmy Neesham brought Corey Anderson on strike. He was adjudged lbw first ball. Neesham advised a review but the DRS left little doubt.
Mosaddek continued his destruction by getting a ball to hold its line to Neesham around the wicket in the next over. The left-hander played for the spin and was stumped for 23 off 24 balls.
Mosaddek finished with three for 13 from three overs but was supported by Taskin (two for 43 off eight) and Rubel (one for 60 off 10).
Mitchell Santner (13 off 16 balls) and Southee (10 off five) were not out.
If Australia lose to England at Birmingham tomorrow, Bangladesh reach the semi-finals.
However, rain is forecast, meaning Australia could exit without playing a game.
The competition rules state if teams are equal on points, the team with the most wins in group matches will be placed in the higher position.
Bangladesh won by five wickets with 10 balls to spare chasing 271 against New Zealand in their previous meeting in Dublin; the first time they had triumphed in 17 ODIs against the Black Caps away from home.
That clearly bred confidence after losing the series in New Zealand 3-0 over summer. Cardiff was a triumph for their developing game.