New Zealand held their nerve under the floodlights to beat Bangladesh by two wickets in a dramatic low-scoring 2019 ICC World Cup match at The Oval on Wednesday.

Chasing a modest target of 245, Ross Taylor and Kane Williamson shared a third-wicket partnership of 105 to put the Black Caps on course for a comfortable victory, but they lost six more wickets before notching up their second win of the tournament with 17 balls to spare.

Williamson should have been run out for eight but Bangladesh wicketkeeper Mushfiqur Rahim dislodged the bails with his arm to waste the chance and the New Zealand captain went on to make 40. Tom Latham was out cheaply and when Taylor was caught by Mushfiqur for 82 Bangladesh scented a famous win.

Colin de Grandhomme, Jimmy Neesham, and Matt Henry also fell as the pressure mounted but Mitchell Santner and Lockie Ferguson stayed calm to edge New Zealand over the line.

Pacer Matt Henry grabbed four wickets as New Zealand bowled Bangladesh out for 244 in their World Cup match at the Oval on Wednesday.

Earlier, Henry finished with figures of 4-47 to follow his three wickets against Sri Lanka as Bangladesh -- sent in to bat -- lost their last six wickets for just 65 runs. All-rounder Shakib Al Hasan hit a fighting 68-ball 64 with seven boundaries in his 200th one-day international but no other batsmen cashed in on good starts.

Once Shakib was caught by wicketkeeper Latham off the bowling of de Grandhomme in the 31st over, the innings fell apart.

Mohammad Mitun (26), Mahmudullah (20) and Mosadeek Hossain (11) all failed to build a significant innings. Tailender Mohammad Saifuddin hit a 23-ball 29 with a six and three boundaries before Henry and Trent Boult (2-44) mopped up the tail.

Openers Tamim Iqbal, who made 24, and Soumya Sarkar, who scored 25, gave Bangladesh a solid base, putting on 45 runs for the first wicket. But Henry made the breakthrough for New Zealand, bowling Sarkar in the ninth over.

That brought Shakib to the crease, much to the appreciation of a large contingent of Bangladeshi supporters. Iqbal was out shortly afterwards, caught by Boult off the bowling of Lockie Ferguson, to leave Bangladesh 60-2.

Mushfiqur Rahim rebuilt the innings with Shakib, putting on exactly 50 for the third wicket before he was run out for 19.