Ireland 271 for 9 (Stirling 82, Dockrell 62*, Khan 2-40, Zadran 2-50, D Zadran 2-65) beat Afghanistan 220 (Ahmadi 48, McCarthy 5-46, Chase 2-45) by 51 runs
Sharjah: Ireland squared their one-day series against Afghanistan and set up Sunday's decider by earning a superb 51-run win in Thursday's second game in Sharjah.
After Tuesday's 138-run hammering, the Irish responded well as Paul Stirling's 82 and George Dockrell's vital late unbeaten 62 helped them reach 271-9.
Barry McCarthy took five Afghan wickets in an impressive Irish bowling display.
Peter Chase dismissed Afghan dangerman Mohammad Nabi as opener Javed Ahmadi top-scored with 48.
Seamer McCarthy's figures were a career best 5-46 with Dockrell and Tim Murtagh also taking wickets before Chase's run-out of Mujeeb Zadran completed Ireland's win.
Ireland looked well placed to record a solid total as Stirling put on 115 for the opening wicket with skipper William Porterfield (47).
Stirling's 96-ball 82 included eight fours and a six but Dockrell's 62 not out was just as important as he steadied the Irish innings after they had slipped to 188-6.
None of the Afghanistan batsmen capitalised on good starts with Rahmat Shah (32), Mohammad Nabi (29) and Nasir Jamal (25) also losing wickets after getting well set.
McCarthy, whose previous best of 4-59 also came against Afghanistan at Belfast last year, sparked a collapse which saw Afghanistan lose their last six wickets for a mere 38 runs.
Both teams are using the series as preparation for the ICC World Cup Qualifiers in March 2018.