Liam Plunkett smashed the final ball of the match for six as England tied a remarkable first one-day international against Sri Lanka at Trent Bridge.
Chasing 287, Jos Buttler's 93 and Chris Woakes's unbeaten 95 helped the hosts recover from 30-4 and 82-6.
Their innings looked to have been in vain until number 10 Plunkett launched Nuwan Pradeep's last ball down the ground and into the stand.
Angelo Mathews scored 73 and Seekkuge Prasanna 59 in Sri Lanka's 286-9.
The tourists remain without a victory against England on this tour, having lost the three-Test series 2-0.
The next match of this five-game ODI series is at Edgbaston on Friday.
A dramatic final over
England went into Nuwan Pradeep's final over on 273-8, requiring 14 runs for victory.
Here is how the late drama unfolded:
- Woakes swats to long-off and Plunkett scrambles to turn it into a two
- Woakes digs out a superb Pradeep yorker. One run
- Another yorker from Pradeep which Plunkett bundles into the off side for a single
- Woakes is almost run out as the bowler gathers the ball and misses with his throw at the striker's end. Dot ball
- Pradeep finds the blockhole again but Woakes scampers three to fine leg
- Plunkett clears his front leg and hammers Pradeep over long-off for six
Buttler and Woakes provide the platform
Plunkett's last-ball heroics were made possible by the superb innings of wicketkeeper-batsman Buttler and all-rounder Woakes.
Buttler came to the crease with England tottering on 30-4, having lost Jason Roy, Alex Hales, Joe Root and Jonny Bairstow for single figures.
Buttler initially provided able support for captain Eoin Morgan, then demonstrated his ability and temperament to build an innings following the loss of his captain for 43.
He scored at about a run a ball throughout, finding the perfect foil in the equally efficient Woakes as the pair added an England ODI record of 138 for the seventh wicket.
Buttler's dismissal - courtesy of a superb leaping catch on the long-on boundary by Dasun Shanaka off Prasanna - looked to have derailed England's hopes of a win.
But Woakes kept them in the game - amassing his highest ODI score in the process - to help set up the last-ball drama.
Contrasting styles help Sri Lanka
Having lost the toss and been put in to bat, Sri Lanka's innings was built around two contrasting half-centuries - one a patient effort from captain Mathews, the other a brief, big-hitting display from Prasanna.
Having arrived at the wicket with the tourists 56-3 after Willey and Woakes had removed the top three cheaply, the cautious Mathews - playing his 172nd ODI - made 73 off 109 balls before falling in the 47th over.
He shared responsibility for steadying the ship with Dinesh Chandimal, who scored 37 in a partnership of 64, while Prasanna accelerated the run-rate by smashing a 28-ball 59 that included eight fours and four sixes.
Prasanna's dismissal - caught and bowled by Woakes - checked Sri Lanka's progress and, despite run-a-ball cameos from Shanaka (20) and Farveez Maharoof (31), they fell short of 300.
Woakes, Willey and Liam Plunkett picked up two wickets each but arguably the pick of the bowlers was spinner Adil Rashid, who went for only 36 from 10 superb overs.
'It was nice to see it sail over the rope' - what they said
England's Liam Plunkett, who made 22 not out off 11 balls, on Test Match Special: "I'm just thinking, I'm going to back myself to hit it straight.
"I managed to get a bit of wood on it and it was nice to see it sail over the rope."
England captain Eoin Morgan: "Three special mentions from me - Jos Buttler, Chris Woakes and Liam Plunkett got us out of a very sticky situation.
"Chris Woakes played out of his skin to put us in a position where it looked like we were going to win the game."
Sri Lanka captain Angelo Mathews: "I thought we had the game in the bag for most of the overs. Unfortunately the yorker fell just off line and went for a six."
Man of the match Chris Woakes: "It's been a good game. We were in a bit of a hole. I had to build a partnership with Jos and it's great to tie it after being in a tricky position.
"They bowled really well but for Plunkett to hit that final ball for six was pretty special."
- Chris Woakes' 95 not out is the highest score by a number eight in ODIs
- This is only the eighth tie in England's 665 one-day internationals
- It is the first tied ODI between England and Sri Lanka