A thrilling LV= County Championship Division One match with many a twist and turn ended with closest challengers Durham beating table-toppers Yorkshire by seven wickets at Scarborough.
Durham's well-deserved win closed the gap on Yorkshire to just 5.5 points and, with a game in hand, Paul Collingwood's men must now be favourites to go on to clinch the title.
Having followed on 299 runs in arrears, Yorkshire went on to reach 419, which left Durham to make 121 in 37 overs after the tea interval.
Ryan Sidebottom's first-ball dismissal of Mark Stoneman, caught at third slip by Kane Williamson, gave home fans in the 2,500 crowd hope that Yorkshire could pull off their first win since 1951 after being forced to follow on.
But Scott Borthwick struck the last two balls of the over for boundaries and Yorkshire were never able maintain the necessary momentum. Gary Ballance spilled Keaton Jennings at first slip with the score on 31 in the ninth over and the same batsman survived a confident appeal for lbw four runs later amid Borthwick rattling on at the other end.
When Adil Rashid joined the attack at 52 for one, Borthwick put away consecutive balls for four and six and his half-century out of 65 for one contained nine fours and a maximum.
Rashid got rid of Jennings at 72 to a sharp catch at short-leg by Phil Jaques and Borthwick was bowled for 65 while swinging at Rashid, but Will Smith and Ben Stokes saw Durham home with little fuss.
The drama did not take long to kick in on a pulsating final day - and it was Stokes who was to put Durham into the driving seat and leave them almost neck-and-neck with Yorkshire in the race for the title.
The White Rose resumed on a hefty 276 for one in their second innings and trailed by only 23. Jaques and Williamson had already put on 257 together, the county's second highest stand for the second wicket at North Marine Road.
They were only able to add seven runs, however, before both fell in the space of three balls from Stokes, who was enjoying a splendid all-round match. All seven runs had been scored by Williamson, who stood on 97 when he was caught at the second attempt by Smith at gully after facing 197 balls and striking 14 fours.
Then, off the second ball of his next over, Stokes produced a beauty which moved away from Jaques late and found the edge for wicketkeeper Phil Mustard to hold the catch. Jaques had made a rousing 152 off 202 deliveries with 23 fours and two sixes.
At 284 for three and still 15 behind, defeat had become a real possibility for Yorkshire, and there was some relief when Jonny Bairstow off-drove Borthwick for four to raise the 300 and take his side into the lead.
But another blow was not long in coming, Jamie Harrison entering the attack to have skipper Andrew Gale snapped up at second slip by Michael Richardson off his first ball.
Ballance took 15 minutes to get off the mark but he and Bairstow added useful runs until the over before lunch when Bairstow whipped a ball from the impressive Chris Rushworth to leg - only to be caught at short midwicket by Richardson for 34.
Yorkshire went uneasily into the break on 351 for five and Rushworth's first ball on the resumption brought him the wicket of Rashid, who chipped lazily to mid-on and Jennings stooped to pick up a good low catch.
Stokes was never far from the centre of the action and it became a perilous 357 for seven as he slanted a ball across Ballance, who followed it and guided into Mustard's gloves.
The situation was dire for Yorkshire, whose lead was only 56 with seven wickets down, but Liam Plunkett and Sidebottom carried out a rescue act that ensured that Durham would face a three-figure target.
The eighth-wicket pair bravely put on 53 before the innings was rapidly wiped out by Borthwick, who took the last three wickets in 3.2 overs without conceding a run, Sidebottom being caught behind and Plunkett and Jack Brooks edging into the slips.