Ireland 237 for 4 (Joyce 105*, Kevin O'Brien 75, Hassan 2-21) beat Afghanistan 236 (Shahzad 81, Kevin O'Brien 3-28, McCarthy 3-57) by six wickets
Scorecard and ball-by-ball details
Ireland's bowlers, led by O'Brien's 3 for 28 in 9.1 overs, put up a strong performance after they lost the toss and dismissed Afghanistan for 236. O'Brien then made another crucial contribution, scoring 75, and his fourth-wicket partnership of 144 with Joyce helped the hosts cruise to the target in 47.3 overs and level the five-match series 1-1. Joyce remained unbeaten on 105.
The chase wasn't smooth until the Joyce-O'Brien partnership: Ireland were reduced to 29 for 3 in the ninth over after Hamid Hassan struck twice. Ireland captain William Porterfield edged to first slip for 1 in the second over, before Sean Terry was trapped lbw for 3 by one that came back in. Asghar Stanikzai introduced spin in the ninth over and the move immediately paid off as Stuart Poynter picked out backward square leg off Mohammad Nabi's second delivery.
Joyce and O'Brien then steered Ireland to safety by batting together for 28.5 overs. O'Brien struck seven fours in his 85-ball knock before falling in the 38th over, with Ireland requiring 64 off 77 balls.
The breakthrough hardly provided respite for Afghanistan. Paul Stirling chipped in with an unbeaten 39 off 37 balls to dominate an unbroken fifth-wicket partnership of 64 with Joyce, who reached his century off the first ball of the 48th over and hit the winning runs two balls later.
Ireland could have been pushed harder if Afghanistan's batsmen had built on Mohammad Shahzad's platform. He held firm with 81, his third consecutive half-century, even as wickets tumbled around him.
Javed Ahmadi, Rahmat Shah and Samiullah Shenwari fell without doing much to leave Afghanistan on 63 for 3 in the 17th over. Shahzad, who had marched to 36, resurrected the innings through a 76-run fourth-wicket stand with Stanikzai. The duo kept Ireland's bowlers at bay for 15 overs, before pace bowler Peter Chase removed both batsmen in the space of three deliveries. Stanikzai chased a wide one and got an edge towards third man where Joyce completed a running catch, before Shahzad found first slip in his attempt to guide a short delivery.
Afghanistan once again lost quick wickets. That they passed 200 was down to Nabi and his 52-run eighth-wicket stand with Rashid Khan, who scored 24 at No. 9. Nabi was the ninth man dismissed, for a 41-ball 40, and Afghanistan were bowled out in 49.1 overs. O'Brien and Barry McCarthy finished with three wickets each.