Durham moved up to second place in the LV= County Championship as they clinched a thrilling 11-run win against Warwickshire at the Emirates Durham ICG.
Needing 257, the visitors were 146 for seven when Jeetan Patel strode to the crease and he got the target down to 25 in a stand of 86 with Ateeq Javid. But the last three wickets would go down for 13 runs as Durham prevailed.
Ben Stokes claimed the final scalp, when he had Boyd Rankin lbw, but the previous two went to Graham Onions, who finished with 5-83.
He broke the partnership when he had Javid well caught at second slip by Scott Borthwick for 44, then Patel went for a big hit and lofted a catch to long-on having just completed his second-half century of the game.
The New Zealander offered late hope after several batsmen had earlier been dismissed to poor strokes.
Varun Chopra fell lbw to Onions for 18, playing across the line, and two overs later Will Porterfield was bowled through an airy drive.
Jim Troughton slapped an Onions long-hop straight to Stokes at point and Ian Westwood chased a wide one from Mark Wood, edging to Phil Mustard.
Javid dug in to support Tim Ambrose, who looked capable of winning the game as he made 46 until he was bowled by a superb yorker from Stokes.
Durham gave Will Smith's off-spin an airing and Keith Barker took a step down the track and hit uppishly straight to midwicket.
Smith was left on after tea, when 81 were needed, and Patel lashed three successive balls to the off-side boundary.
He looked certain to win the game, but lost his cool once Javid had gone and gave a simple catch to Keaton Jennings.
With 22 needed, Chris Wright hit the next two balls for four, but Stokes summoned the strength to complete Durham's fourth win of the season.