India were knocked out of the Asia Cup tournament after Bangladesh continued their giant-killing act by upsetting Sri Lanka by five wickets in the last league match in Mirpur.
Chasing a revised target of 212 after a rain interruption, the spirited hosts held their nerve to make their maiden entry into the summit showdown of the tournament where they will meet Pakistan on Thursday.
Nasir Hossain (36 not out) hit the winning boundary straight down the ground as the home crowd at the jam-packed Sher-E-Bangla National Stadium went into a state of frenzy.
Tamim Iqbal (59), Shakib Al Hasan (56), Hossain (36) and Mahmadullah (32) were the notable batting heroes for Bangladesh who recorded their second consecutive upset wins after having beaten India last Friday.
Put into bat, Sri Lanka were all out for 232 in 49.5 overs with Chamara Kupugedegera (62), Lahiru Thirimanne (48) and Upul Tharanga (48) making significant contributions.
But the target was reduced to 212 in 40 overs after a heavy downpour during the innings break, which lasted for a little more than an hour.
India needed a Sri Lankan victory to qualify for the final but now will have to pack their bags and return home.
They had to pay the price for the shock defeat against Bangladesh.
Prior to the match, Bangladesh were on four points and India on eight. But the hosts' win shut the door on India as they had defeated the Men in Blue earlier in the meet.
As per the rules of the tournament, if two teams are tied on points, head-to-head record is considered.
Sri Lanka had a chance as Bangladesh were off to a bad start, losing three wickets with just 40 runs on the board.
But opener Iqbal and Shakib staged a remarkable comeback, adding 76 runs for the fourth wicket in just over 12 overs.
The duo seemed to be playing sensible cricket before Iqbal fell to off-spinner Sachithra Senanayake.
The offie then trapped Shakib to deal another blow to the hosts in a crucial phase of the match.
But Hossain and Mahmudullah kept their cool and in the end finished the job with 17 balls to spare.
Earlier, Bangladesh kept their hopes alive for a place in the final by restricting Sri Lanka to a modest total.
Kapugedera, Thirimanne and Tharanga made useful contributions in the middle-order after a top-order collapse saw the islanders reeling at 32 for three in 10 overs.
Comeback man Nazmul Hossain was the pick of the bowlers with figures of three for 32 while left-arm spinners Shakib-al Hasan (2/56) and Abdur Razzaq (2/44) also got important breakthroughs.
Medium pacer Hossain, who was drafted into the XI in place of Shafiul Islam, struck triple blows within the first 10 overs.
Nazmul, who played his last ODI back in October last year, bowled with a lot of control as he rocked the Lankan top-order removing Mahela Jayawardene (5), Tillekaratne Dilshan (19) and Kumar Sangakkara (6).
Jayawardene who has played some poor shots in the two earlier matches once again tried to play across the line to a delivery that moved in a shade and breached his defence.
Sangakkara tried to play an expansive cover drive off Nazmul only to be caught by Nazimuddin.
Dilshan hit three boundaries during his brief stay but then inside-edged one on to his stumps.
Thirimanne and Kapugedera then joined hands to stem the rot. The duo didn't take too many risks as they went on doing their job quietly.
Thirimanne missed out on a half century when he charged out to a Razzaq delivery that was going down leg-side. The ball ricocheted off Rahim's pads and hit stumps with the batsman out of his ground.
Kapugedera completed his eighth ODI half-century with a push towards mid-on that fetched him two runs. He found an able ally in Upul Tharanga (48) who was positive from the onset as they added 49 runs for the fifth wicket stand.
Kapugedera was finally dismissed for a well-made 62 off 93 balls (4x4) when he tried to hit a cover drive off Razzaq only to find that Shakib pouching a brilliant low catch.
Ferveez Maharoof (3) and Nuwan Kulasekara (1) soon followed and Sri Lanka were again down in the dumps with scorecard reading 183 for seven.
But Tharanga didn't stop playing his shots as he hit Shakib for a huge six over long on and then pushed down fine leg for a boundary that brought the team's 200.
Tharanga also missed out on a half century when he edged one off Shahadat Hossain trying to steer it down to third-man.
It was Sachitra Senanayake (19 not out) and Lasith Malinga (10) who added valuable 26 runs for the ninth wicket to give the Lankan total some respectability.