Kevin O'Brien hit a last-ball six as Ireland clinched a consolation Super Over win against Afghanistan in the third Twenty20 international in India on Tuesday.
With three runs needed for victory off the final ball of the Super Over, O'Brien cleared the long-off fence to end his team's 12-match losing streak in T20s against the Afghans.
O'Brien made 26 off 21 balls in Ireland's 142 for eight after electing to bat first.
Afghanistan, who won the series 2-1, replied with 142 for seven.
"Luckily that last hit came off," a relieved O'Brien said after receiving the man of the match award.
"We have learnt from game one to game three, about specific plans for each player. You have to adjust quickly and I think we did."
Afghanistan needed 16 to win off the final six deliveries of normal play, and paceman Craig Young claimed Asghar Afghan for 32 before Rashid hit a boundary off the last ball, taking the game into a deciding over.
Young then bowled a disciplined line and length to keep Afghanistan to just eight runs in six balls.
Gareth Delany also played a key part in Ireland's win after top-scoring with 37 and then taking two wickets with his leg-spin.
Off-spinner Simi Singh hurt Afghanistan's middle-order with two wickets off successive balls to send back Mohammad Nabi, for four, and Najibullah Zadran, for nought.
Wicketkeeper-batsman Rahmanullah Gurbaz top-scored with 42 and was named player of the series for amassing 105 runs in the three matches.
Bowlers Naveen-ul-Haq and Qais Ahmad took three wickets each in the Ireland innings.
"I think the wicket was good but our batsmen played some poor shots," said Rashid.