Ben Stokes finally came to the party for Durham, ending their relegation worries by taking four Surrey wickets in a gripping finish at the Emirates Riverside.
After scoring 24 and nought, and remaining wicketless until the final session, Stokes took four for 54 as Surrey were dismissed for 259 to lose by 21 runs.
Jason Roy fell four short of his second century of the match, but Surrey were kept in the hunt by a fearless unbeaten 50 from 18-year-old Sam Curran to go with his seven for 58 in Durham’s second innings.
Surrey could have slight concerns over Roy and Zafar Ansari ahead of Saturday’s Royal London Cup final after both needed treatment for hand injuries.
Following their first innings stand of 164, the pair put on 143 after coming together at 11 for three in pursuit of 281.
After the persistent murk of the previous day, play again began with the floodlights on, but the sun was starting to emerge as Roy went to the crease and batting became more comfortable after lunch.
Durham were convinced Roy had edged Brydon Carse’s first ball to wicketkeeper Stuart Poynter, when he was on nine, and then he edged the next ball where third slip had been prior to becoming a second gully.
Roy played with calm authority afterwards, but was struck on the hand by Carse on 44.
After a lengthy delay he hooked the paceman to fine-leg for one of the nine fours in his 79-ball half-century.
Ansari was on 32 when he needed treatment following a ball from Mark Wood.
Two on-driven fours off Graham Onions provided the highlight as he progressed to 51.
Durham had to turn to Scott Borthwick and in his second over he turned one sharply into the left-hander to have him lbw on the back foot.
Roy’s 132-ball innings was ended by the first ball after tea when he gloved an attempted pull off Stokes to the wicketkeeper.
Sam Curran cracked Stokes to the cover boundary three times off the back foot before the England all-rounder tightened up with three successive maidens, the last of which included two wickets.
A stand of 54 ended when Ben Foakes pushed firmly and edged to Borthwick at second slip.
Two balls later Tom Curran edged to Poynter, bringing in Gareth Batty with 59 needed.
He helped to add 30 before falling to a stunning catch by Keaton Jennings, diving to his left at third slip.
Onions took the last two wickets, Stuart Meaker edging a drive to first slip before Mark Footitt had his stumps splattered.
In the morning, Durham’s two remaining wickets added what proved to be a valuable 33 runs.
Curran took his seventh wicket when Onions drove a full toss to mid-off and Durham were all out for 246.
Wood quickly took two wickets when Surrey batted, producing a snorter to have Kumar Sangakkara well caught by Poynter second ball.
It did not look good for Surrey, but Roy, Ansari and the younger Curran ensured a thrilling climax.