Bangladesh gave co-hosts New Zealand a real scare but fell just short of securing another Pool A victory at the World Cup on Friday.

The Tigers established a strong position thanks to a ton from top-scoring Mahmudullah, yet New Zealand boasted a centurion of their own in Martin Guptill, who shrugged off injury to make 105 at Seddon Park.

Shakib Al Hasan was the pick of the bowlers with his four wickets maintaining belief Bangladesh could restrict the Black Caps in Hamilton. A late flurry from Tim Southee, however, got the home team over the line as they recorded a three-wicket triumph.

Both sides had already qualified for the quarter-finals, but the result is perhaps more heartening for the Tigers.

They registered 288 for seven from their 50 overs, having been put into bat.

Mahmudullah, having become his country's first World Cup centurion in Monday's win over England, made it back-to-back hundreds with a brilliant 128 not out.

The Bangladesh innings got off to a shaky start, with openers Imrul Kayes (two) and Tamim Iqbal (13) dismissed within the first 10 overs.

Trent Boult snared both, knocking over Kayes' off stump and inducing an edge from Tamim which was snapped up by Corey Anderson at second slip to send the bowler back top of the 2015 World Cup wicket-takers' list.

Soumya Sarkar (51) and Mahmudullah steadied the ship with a 90-run third-wicket stand, before the former bottom-edged a Daniel Vettori delivery to Anderson at long-on.

Anderson then got in on the action with the ball, accounting for the wickets of Al Hasan (23) and Mushfiqur Rahim (15) - both caught behind by Luke Ronchi.

Sabbir Rahman contributed 40 and Nasir Hossain 11 before falling to Grant Elliott in the final three overs.

New Zealand also made a wobbly start, quickly losing both Brendon McCullum and Kane Williamson.

The former was snagged by Al Hasan for eight while Williamson sliced over to Iqbal for a single off the same bowler.

It fell to Guptill and Ross Taylor to steady the ship and the pair brought up 50 runs before the latter reached 5,000 ODI runs with a four off Rahman.

Guptill was fast approaching his century when he suddenly pulled up after glancing for a single. After a few nervous minutes it became clear the opener was suffering from a bad bout of cramps.

He gritted his teeth and soon brought up his maiden World Cup ton with a single off Taskin Ahmed.

Guptill was, however, gone for 105 when Al Hasan struck again, the Bangladesh bowler making another key breakthrough as his opponent tried to clear Rubel Hossain only to find him at long on.

Elliott had contributed 39 runs before slicing to Ahmed at sweeper cover and succumbing to Rubel Taylor followed in the 42nd over, Hossain striking him in front of middle and leg. Anderson's intervention meant the decision went to review, but DRS confirmed the end of his 56-run stand.

Ronchi (nine) became Shakib's fourth victim and Anderson followed for 39 as Nasir tricked him with a flatter delivery, but the Black Caps held their nerve.

Southee was the matchwinner, sealing a three-wicket victory as he smashed a six and a four in back-to-back balls.