Afghanistan gave West Indies a hint of the struggle that could be in store for them in their bid to reach the 2019 World Cup, after battling back from the brink of a crushing defeat to pull off a remarkable victory in their warm-up encounter in Harare, ahead of next week’s ICC World Cup Qualifiers.

The two teams are among the favourites to claim the final two spots for next year’s tournament in England, but for West Indies, two-time world champions in 1975 and 1979, failure to progress would be a particularly ignominious moment in their history.

And the manner in which they capitulated in this contest, first with ball and then bat, will have given them few reasons for optimism going into their opening fixture against UAE next week, even though they have welcomed back into their ranks the likes of Chris Gayle and Marlon Samuels, who played key roles in their triumphs at the World T20 in 2012 and 2016.

After winning the toss and choosing to field first, West Indies appeared to have the contest in their pocket after reducing Afghanistan to 71 for 8 in 23 overs. Without their captain, Asghar Stanikzai, who has been hospitalised with appendicitis, Afghanistan appeared rudderless as the left-arm seamer, Sheldon Cottrell, set the tone with two wickets in the first five overs of the match.

But Afghanistan’s spirit is redoubtable at the best of times, and when Samiullah Shenwari and Gulbadin Naib came together in a ninth-wicket stand of 91 in 11.5 overs, Afghanistan found themselves back in the contest.

With bad weather reducing the match to a 35-over affair, West Indies lost Gayle and Shai Hope early as they chased a revised total of 140, but Evin Lewis and Marlon Samuels appeared to have steadied the pursuit with a stand of 44.

However, Sharafuddin Ashraf bagged Lewis and Jason Mohammed for a duck in the space of four balls to leave West Indies teetering on 80 for 4, and when Shapoor Zadran added Samuels for 34 three overs later, the writing was on the wall.

Dawlat Zadran returned to rip through the tail with final figures of 4 for 26, which included a hat-trick that saw the end of Shimron Hetmyer (caught at gully by Najibullah Zadran), Rovman Powell (caught by Mohammad Shahzad) and Carlos Brathwaite (lbw) off successive deliveries of his fifth over. Captain Rashid Khan – the newly crowned No.1 bowler in ODI and T20I cricket – subsequently sniped out the final two West Indies wickets with his legspin.