Lasith Malinga grabbed four wickets as Sri Lanka stunned England to triumph in a tense, low-scoring thriller at Headingley.
England looked overwhelming favourites after restricting their opponents to 232-9 from their 50 overs - but Malinga's return of 4-42 rolled them over for 212 and clinched a 20-run victory.
Ben Stokes, with an undefeated 82 from 89 balls, made a valiant attempt to rescue his side but he was left stranded as Sri Lanka sealed the win with three overs remaining.
The defeat, England's second of the tournament, puts their prospects of qualifying for the semi-finals in jeopardy - but keeps Sri Lanka's hopes of reaching the last four very much alive.
Sri Lanka's tendency to lose wickets in clusters seemed to have cost them dearly again after they won the toss, chose to bat and promptly slid to 3-2, with both openers gone after just 14 deliveries of the innings.
Captain Dimuth Karunaratne (1) was the first to go, edging Jofra Archer (3-52) behind before Kusal Perera (2) perished as he lifted Chris Woakes into the hands of third man.
But Avishka Fernando, drafted in for his first appearance of the tournament, made an immediate impact as he gave England's bowlers the charge with some big hitting in the powerplay.
Fernando amassed 49 from 39 balls, flaying Archer for 14 in one over and utterly dominating a partnership of 59 with Kusal Mendis, only to miss out on a half-century as he skied Mark Wood (3-40) to Adil Rashid in the deep.
Mendis (46) and Angelo Mathews appeared to have rebuilt the innings with a stand of 71 - but Rashid (2-45) then inflicted a decisive double blow by capturing two wickets in as many deliveries.
Eoin Morgan dived to his left at mid-wicket as Mendis swept the leg-spinner from outside off stump and new batsman Jeevan Mendis then steered his first ball straight back to the grateful bowler.
Mathews remained unbeaten on 85 while wickets tumbled around him, with Dhananjaya de Silva (29 from 47) the only remaining batsman to achieve double figures in Sri Lanka's modest total.
Just like their opponents, England's opening pair were soon back in the hutch, with Jonny Bairstow prodding at his first delivery and failing to get bat on ball as Malinga successfully appealed for leg before.
James Vince (14) appeared to be emerging from his early shell with two boundaries in an over off Malinga, but he was caught at second slip attempting a third to leave England in trouble at 26-2.
Joe Root (57) and Eoin Morgan set about retrenchment, but they struggled to lift the scoring rate, adding 47 from almost 12 overs before the captain (21) punched a full toss straight back to Isuru Udana.
Stokes was soon into his stride, hammering Jeevan Mendis for two sixes in quick succession, and it looked as if his partnership of 54 with Root might develop into a match-winning one.
However, Malinga's return to the attack tilted the game in Sri Lanka's favour as he had Root given out on review, caught behind off a leg glance, and then pinned Jos Buttler lbw with an inswinging yorker.
Spinner De Silva (3-32) increased the pressure on England, accounting for Moeen Ali (16) - who holed out after hitting the previous delivery for six - and then dismissing Woakes (2) and Rashid (1) in the same over.
Stokes did his best to rescue the situation, clubbing successive sixes off Udana, but Archer (3) and Wood (0) were unable to stay with him as England sank to defeat.
Sky customer? With Sky VIP - your free loyalty programme - you could be right at the heart of the Ashes action with a once-in-a-lifetime opportunity to join the captains on the pitch for the coin toss at Edgbaston. Enter now on the My Sky app.