Akila Dananjaya's career-best 6-54 was in vain as India beat Sri Lanka by three wickets in their second one-day international to go 2-0 up in the five-match series on Thursday.
Dananjaya ran through India's top and middle order but Mahendra Singh Dhoni and Bhuvneswar Kumar batted sensibly to complete a tricky chase under the Duckworth-Lewis method with 16 balls to spare.
Chasing 231 from 47 overs after a rain intervention, India were cruising at 109 for no loss but the 23-year-old Dananjaya claimed three wickets in one over to turn the match on its head.
The Indian batsmen repeatedly failed to read Dananjaya's googly and lost their wickets.
There had been no inkling of the impending collapse when Rohit Sharma and Shikhar Dhawan led India's brisk reply with a century stand.
Dananjaya trapped Sharma leg before for 54 and Dhawan (49) swept Milinda Siriwardene towards fine leg where Angelo Mathews lunged to take a stunning catch.
A maverick spinner who can bowl off-spin, leg-spin, googly and even "doosra", the ball that turns the other way, Dananjaya injected drama into the contest when he clean bowled Kedar Jadhav, Virat Kohli and KL Rahul within five balls.
He dealt two more blows to leave India reeling on 131-7 when Dhoni reprised his finisher's role and Kumar proved a perfect foil as they bailed out India with a century partnership.
Dhoni's risk-free 45 not out included only one boundary while Kumar hit a six and four fours in his unbeaten 53.
Earlier, paceman Jasprit Bumrah claimed 4-43 to help restrict Sri Lanka to 236-8 after India captain Kohli opted to field.
Niroshan Dickwella hitting Bumrah for a couple of sixes before being dismissed by the paceman for 31.
Leg-spinner Yuzvendra Chahal struck twice to reduce Sri Lanka to 121-5 when Milinda Siriwardana and Chamara Kapugedera offered some resistance with a 91-run partnership.
Bumrah returned to torment the Sri Lankans with his unorthodox action and his mastery over yorkers and slow deliveries.
The 23-year-old ended Siriwardana's run-a-ball 58, yorked Kapugedera (40) and sent back Dananjaya as Sri Lanka settled for a below-par total before it started raining.
The teams return to the venue for the third match on Sunday.
India 231 for 7
(Rohit 54, Bhuvneshwar 53*, Dhawan 49, Dananjaya 6-54) beat Sri Lanka 236 for 8
(Siriwardana 58, Bumrah 4-43) by three wickets (DLS method)