Afghanistan will join fellow qualifiers West Indies in the 10-team World Cup to be staged in England and Wales next year.
Afghanistan, after losing their opening three qualifying games, upset the odds to beat Ireland by five wickets on Friday to qualify for next year's Cricket World Cup.
Asghar Stanikzai, coming back from a bout of appendicitis, hit an invaluable 39 not out off 29 balls to guide the Afghans to 213 for five in reply to Ireland's 209-7.
Afghanistan will join fellow qualifiers West Indies in the 10-team World Cup to be staged in England and Wales from May 30-July 14, 2019, alongside defending champions Australia, India, Pakistan, Sri Lanka, Bangladesh, England, South Africa and New Zealand.
After Scotland and Zimbabwe had both suffered defeats in their concluding Super Six matches earlier in the week, Friday's game at the Harare Sports Club suddenly became a winner-takes-all clash.
Ireland won the toss and elected to bat with opener Paul Stirling making a top score of 55 and Kevin O'Brien hitting 41 in a modest total of 209-7 off their 50 overs.
Afghanistan leg-spinner Rashid Khan finished with 3-40 to take his career tally to 99 ODI wickets.
In reply, burly opener Mohammad Shahzad clobbered 54 off 50 balls in an opening stand of 86 with Gulbadin Naib.
But once Shahzad holed out, Afghanistan, who only squeezed into the Super Sixes after losing to Scotland, Zimbabwe and Hong Kong, began to wobble.
But skipper Stanikzai and Najibullah Zadran, the latter finishing on 17 not out, settled the side and led the Afghans to a memorable victory with five balls to play.
Ireland: 209/7 off 50 overs (Stirling 55, L O'Brien 41; Rashid Khan 3-40)
Afghanistan: 213/5 off 49.1 overs (Mohammad Shazad 54, Gulbadin Naib 45, Stanikzai 39no; Simi Singh 3-30)