Set 317 to win at the Divisional Stadium, the BLACKCAPS recorded their highest ever successful fourth innings run chase on foreign soil to win a test that for large parts of which they played second fiddle to the hosts.
Vettori led the way, coming in as nightwatchman late on the fourth day, to hit his 18th test fifty to complete a superb match in which he scored 55 not out in the first innings and had match figures of 9-133.
Vettori gained valuable support initially from Aaron Redmond and then young left-hander Daniel Flynn.
He was restrained during his innings and it was something of a surprise to see him dismissed 19 runs shy of victory. He was bowled playing an ugly shot across the line to a ball from left-arm spinner Abdur Razzak.
Earlier, the patient Redmond shared in a 40-run stand for the third wicket with Vettori before he was undone on 79 by first innings destroyer Shakib Al Hasan who caught the edge of his bat and Zunaed Siddique claimed the catch at slip.
His determined innings spanned 237 balls and gave the BLACKCAPS a much-needed foundation on which to build their pursuit of 317.
Flynn played a mature innings to steady the innings after the loss of Ross Taylor (9) and Brendon McCullum (2) either side of lunch.
Taylor played a loose cut to point to gift Mashrafe Mortaza his first scalp while McCullum was cut off by Sri Lankan umpire Asoka de Silva, who adjudged him leg before wicket to Razzak despite the ball clearing pitching outside leg stump.
Flynn, playing in his fourth test, was very watchful, but was quick to punish anything loose with his innings of 49 punctuated with six boundaries. He added an invaluable 82 with Vettori.
He was nearly caught by Mohammad Ashraful going back at mid on with seven runs needed for victory but survived only to fall to a bat-pad catch with the scores tied.
It was left to Kyle Mills to hit the winning runs which he did from the fourth ball he faced after a misfield from bowler Shakib who ended the match with figures of 9-115.
The successful run chase surpassed the previous highest of 164-4 made at the WACA in Perth to clinch the 1985 series with Australia.New Zealand beats Bangladesh by three wickets in first cricket Test
The Canadian Press
Vettori pleased with fightback
David Leggat: Dan's the man on NZ's big day
New Zealand Herald, New Zealand
Inspired Vettori dashes Bangladeshi cricket hopes
Vettori thrilled with chase
Vettori says NZealand must improve
Daniel Vettori leads New Zealand to victory over Bangladesh
Telegraph.co.uk, United Kingdom