Bangladesh 320 for 7 (Shanto 117, Hridoy 68, Campher 2-37) beat Ireland 319 for 6 (Tector 140, Dockrell 74*, Mahmud 2-48) by three wickets
Chelmsford: Bangladesh beat Ireland by three wickets in a dramatic second one-day international at Chelmsford to take a 1-0 lead in the series.
Set 320 to win a match reduced to 45 overs a side by rain, Bangladesh triumphed with three balls to spare thanks to Mushfiqur Rahim's 36 not out.
Najmul Hossain Shanto made 117 and Towhid Hridoy 68 to set up their chase.
Harry Tector hit 140 off 113 balls and George Dockrell an unbeaten 74 off 47 in Ireland's 319-6.
The final match of the series takes place at the same venue on Sunday.
Ireland, who needed to win the series 3-0 to retain hope of automatic World Cup qualification, will compete in a 10-team qualifying tournament in Zimbabwe starting next month.
Tector hit 10 sixes - a record for an Ireland player in an ODI - in making his fourth century in his past nine matches. He now averages 53.69 in 31 games in the format.
He added 98 for the third wicket with captain Andy Balbirnie and 115 for the sixth with Dockrell before being bowled by Ebadot Hossain with three overs remaining.
Shanto and Hridoy's fourth-wicket stand of 131 formed the centrepiece of Bangladesh's pursuit.
However, they fell in the space of three overs and Mehidy Hasan's departure left them 286-6, needing 34 off 38 balls and leaving Mushfiqur with only the tail for company.
He was almost run out with 26 needed off 23 deliveries, and Paul Stirling dropped Taijul Islam two balls later.
Josh Little trapped Taijul Islam lbw in the penultimate over to leave Bangladesh needing five off the last.
Mushfiqur failed to score off the first two deliveries and was caught at deep backward square-leg off the third, but Mark Adair was no-balled for a waist-high full toss.
Mushfiqur ramped the the free hit over wicketkeeper Lorcan Tucker's head to seal a thrilling victory.