Afghanistan 254 for 8 (Naib 82*, Shahidi 31, Jongwe 3-50) beat Zimbabwe 248 (Masakadza 110, Moor 42, Hamza 3-41) by two wickets
Scorecard and ball-by-ball details

Gulbadin Naib played the most important innings of his international career to hand Afghanistan a sensational comeback win that not only lifted them to their second 3-2 series win against Zimbabwe, but also ensured the team broke into the top 10 in the ODI rankings.

Naib, who played his last ODI in February 2015, struck his first international fifty, and exhibited a calm demeanor and splendid stroke-making ability to guide Afghanistan to the 249 target with two wickets and two balls to spare. Naib's heroics overshadowed Hamilton Masakadza's, who compiled his fourth ODI century with staggering ease and a brisk strike rate too.

The contest swung one way and then the next towards the last few overs of the chase. When Naib lost his ally Rashid Khan in the 48th over, he was forced to rethink his strategy with the tail. The match hung in the balance till the last over, when 10 runs were needed. Naib found an edged boundary to third man and after brace of twos, Afghanistan had leveled the score. Naib proceeded to thump the next ball - low full toss - to the roof of the stand at square leg, sparking wild celebrations among the Afghanistan players and staff.

Such was the state of the thrilling contest that even with five overs to go, it was anybody's game. Afghanistan needed 46 with four wickets in hand. The 46th over, given to Neville Madziva, proved to be the game changer. Madziva missed his length and offered Naib two full tosses, both of which were heaved to the leg side boundary. That over cost Zimbabwe 16 runs, the momentum, and as would eventually turn out, the series. Although Madziva bounced back with two wickets in his next over, it proved too little and slightly too late.

Defeat would have especially hurt Zimbabwe as they seemed to have the match wrapped up when Asghar Stanikzai was sixth man out with 104 needed off 93 balls on a slow wicket. However, Naib and Rashid got together to tip the contest in Afghanistan's favour. It was the Zimbabwe's bowlers turn to crumble under the pressure as Naib swiped low full tosses to the leg-side boundary and the seamers missed their attempted yorkers.

Afghanistan's openers Mohammad Shahzad and Noor Ali Zadran continued to show their form in contrasting manner. While Shahzad used his muscular prowess to bash boundaries over the infield, Noor Ali used deft touch, timing and placement to scythe fours through the fielders. Nonetheless, both found the boundaries with regularity to get Afghanistan ahead of the asking rate with a brisk stand of 49.

But as had been the case throughout the series, the ball dominated the bat under lights after the end of the first Powerplay. Luke Jongwe made the first incision with a ripper, one that ducked back in just enough to rattle Shahzad's stumps. Noor Ali got another start before being drawn into a false stroke, as he top-edged a sharp bouncer to fine leg. Afghanistan's main men were dismissed and a tricky chase got even harder. Jongwe was the wrecker-in-chief again.

Unlike the first innings, seam and spin combined well to swell the required rate. Although assisted by significant movement off the pitch, the Zimbabwe bowlers initially found the right areas to beat the bat frequently. Mohammad Nabi and Hashmatullah Shahidi strung together a 55-run stand but the pressure of the chase resulted in both their wickets, in the space of four balls. Graeme Cremer first went through Nabi's inside edge to trap him in front and then Sikandar Raza had Shahidi bowled with a slider. When Raza slid another one through to have Asghar Stanikzai caught behind, Afghanistan not only had to repair the damage, they had to first plug the leak. Thankfully for the hosts, Naib managed to do both with equal aplomb.

Earlier, it was Masakadza's experience and patience that transformed Zimbabwe's batting, propelling the team to 248. Such was the impact of Masakadza's 111-ball 110 that Zimbabwe had hoped for a score close to 280 at one stage. However, Afghanistan's bowlers bounced back in the death overs after a slapdash middle period.

As was expected from the start, run-scoring proved to be hard, but Afghanistan had themselves to blame with a discernibly sloppy period in the middle. Half-volleys, long-hops and full tosses were dispatched with ease and catches were spilled.

Masakadza, in particular, cashed in on many such run-scoring opportunities, forcing spinners off their lengths with powerful sweeps and efficient utilization of the depth of the crease. His strike-rate for the most part hovered around 100 as he ensured the bowlers struggled to string together dot balls.

Peter Moor and Richmond Mutumbami also benefited from Masakadza's pyrotechnics and were allowed to play valuable cameos in their own fashion. Moor employed a block-launch approach, while Mutumbami used the slog sweep to pile on the misery, including one that left the ground over the midwicket boundary off Hamza in the 30th over.

Mutumbami's dismissal, though, elicited an Afghanistan comeback. Afghanistan's bowlers quickly found their lengths and were rewarded with results. All the lower order could do was huff and puff their way to Zimbabwe's second-highest score of the series.

Nikhil Kalro is a sub-editor at ESPNcricinfo