Flawed strokemaking and inept umpiring combined to ramp up the tension before a Daniel Vettori-inspired New Zealand completed their greatest run chase on foreign soil to win first cricket test against Bangladesh in Chittagong today.
Set 317 for victory, New Zealand lurched across the line midway through a dramatic final session at the Divisional Stadium.
When Kyle Mills scampered the winning single to take New Zealand to 317 for seven it represented their highest successful fourth innings run chase overseas in their 343-test history - eclipsing the 164 for four made at Perth's WACA ground to clinch the 1985 series against Australia.
New Zealand had the luxury of five sessions and 154 overs to reach their goal but they still required a massive input from Vettori to avoid becoming the first major cricketing nation to lose to the sub continent's so-called minnows.
Vettori was immense, providing the epitome of a captain's knock as he practically denied Bangladesh a coveted second test triumph singlehandedly.
Not content with taking nine wickets and top scoring with a face-saving 55 in New Zealand's meagre first innings, Vettori surpassed those achievements by marshalling the pursuit expertly after arriving at the crease with a tricky 172 runs still required.
The skipper, who astutely employed himself as nightwatchman three overs before stumps last night after Jesse Ryder ran himself out, marshalled New Zealand's painstaking pursuit with a resolute 76, the first time he has scored a fifty in both innings of a test.
Vettori, 0 not out overnight, remained steadfast from the first ball of day five, until he was bowled by Abdur Razzak when attempting tired a slog sweep.
That initially left Daniel Flynn and Jacob Oram to tick off the last 19 runs - an assignment not without its jitters.
The allrounder could have been run out when scampering to get off the mark and Flynn was then denied a maiden test 50 when he was caught bat pad a run shy when the scores were tied.
Vettori's sterling service was not spoiled though, and deservedly so.
He faced 217 balls and struck seven boundaries in between long periods of staunch defence.
The left hander added 40 with opener Aaron Redmond and a soothing 82 with Flynn for the sixth wicket in difficult circumstances.
The 84-cap veteran and four-test rookie united when Bangladesh sensed a momentum shift after New Zealand lost Redmond, Ross Taylor and Brendon McCullum in the space of 31 runs.
But Vettori and Flynn maintained their composure in the face of a sequence of ear-splitting Bangladeshi appeals that eventually drew a mild rebuke from Australian umpire Daryl Harper.
Bangladesh became more vocal either side of lunch, and understandably so after Taylor and McCullum fell in quick succession.
Taylor (9) had only himself to blame when he scooped a short pitched offering from Mashrafe Mortaza to substitute fielder Mahbubul Alam at point.
Then seven balls into the middle session Bangladesh had more cause for celebration when Sri Lanka umpire erred in giving McCullum out leg before wicket to Razzak for two despite the ball clearly pitching outside leg stump - criteria to find in favour of the batsman.
The aggressive McCullum's unfortunate demise left New Zealand at an edgy 216 for five but Vettori took test rookie Flynn under his wing to good effect.
Accustomed to batting under challenging circumstances after debuting in England five months ago, Flynn proved the ideal companion for Vettori, adopting a patient approach before peeling consecutive fours to go to 17 and break a 145-ball drought without a boundary.
He persevered for 126 balls before left arm spinner Shakib Al Hasan stalled the victory celebrations momentarily.
Redmond set the circumspect tone from the top of the order yesterday with his maiden test fifty, knuckled down again today.
He added 40 with Vettori while advancing from 62 to 79 before edging Al Hasan to Junaid Siddique to end an admirable resistance that spanned 237 balls, 10 of which crossed the boundary.
Al Hasan, who took seven for 36 in New Zealand's first innings backed up with two for 80. Fellow left arm tweaker Razzak took three for 93 off a marathon 50 overs to no avail.
First innings 245
Second innings 242
First innings 171
Second innings (target 317; 145-2 overnight)
J How b Razzak 36
A Redmond c Siddique b Al Hasan 79
J Ryder run out (Mortaza) 38
D Vettori b Razzak 76
R Taylor c sub (Alam) b Mortaza 9
B McCullum lbw b Razzak 2
D Flynn c Islam b Al Hasan 49
J Oram not out 8
K Mills not out 1
Extras (13b 3lb 3w) 19
Total: (for 7 wkts, 137.5 overs) 317
Fall: 55 (How), 145 (Ryder), 185 (Redmond), 209 (Taylor), 216 (McCullum), 298 (Vettori), 316 (Flynn)
Bowling: M Mortaza 14-4-37-1 (2w), S Hossain 11-1-46-0 (1w), A Razzak 50-15-93-3, S Al Hasan 44.5-16-80-2, M Hossain jnr 2-0-6-0, N Islam 12-3-15-0, M Ashraful 4-0-24-0.
Result: New Zealand win by three wickets, lead two-match series 1-0.
Man of the match: Daniel Vettori (NZ)