Durham 123 for 9 (Mustard 40, Rashid 3-14 Rafiq 3-30) beat Yorkshire 95 (Hastings 3-22) by 28 runs
Yorkshire's hopes of reaching the NatWest T20 Blast quarter-finals were dented on Wednesday as they collapsed to 95 all out in pursuit of 124 against Durham at Headingley.
But Yorkshire were in turn mesmerised by the spin of Scott Borthwick and Gareth Breese, stuttering from 47 for 2 to 95 all out as Durham sealed a 28-run victory.
Yorkshire remained in fourth place in the North Group table despite the shock defeat, while Durham stayed in the hunt with their fourth win of the season.
Rashid and Rafiq enjoyed an equal share of six wickets at a cost of only 34 runs, but then Borthwick turned the screw with 2 for 11 off his four overs and Breese captured a wicket in his 1.2 overs.
Durham's best figures, however, were returned by paceman John Hastings, who ended with 3 for 20 as Yorkshire just pipped their lowest ever T20 score of 90 for 9 - also against Durham at Chester-le-Street in 2009.
The 5,071 crowd saw Durham misfire so badly that, had Rashid not dropped a low return chance from last man Chris Rushworth, they would have been all out for 94 - one fewer than Yorkshire went on to make. But Breese and Rushworth then made the most of the escape with an unbroken stand of 29 - the highest of the innings.
Ryan Sidebottom made the initial breakthrough for Yorkshire with the last ball of his first over, which Mark Stoneman hit straight to Rafiq at point - the first of several batsmen to perish by giving the simplest of catches.
Phil Mustard settled in with a couple of early boundaries but wickets continued to topple, Paul Collingwood well taken by Adam Lyth above his head at mid on off Rich Pyrah and Michael Richardson falling to a fast slip catch by Aaron Finch from an edged drive.
That made it 33 for 3, but Durham's problems were only just beginning as Rafiq and Rashid took full control, offspinner Rafiq's figures of 3 for 20 being his best for three years.
It was Rashid, however, who struck one of the biggest blows by getting rid of Mustard for 40 off 43 deliveries with four fours to make it 76 for 7, the opener leaving his crease to be stumped by Jonny Bairstow. With his next ball, Rashid had Usman Arshad lbw to complete a double-wicket maiden.
Yorkshire's demise began with the first ball of the second over of the innings from Hastings, which Andrew Gale hit towards the midwicket boundary where he was nicely held by Richardson.
Finch and Alex Lees settled things down until Lees played on to Hastings, and the dismissal of Finch - lbw to Borthwick's second ball - signalled the start of the rot. Borthwick's next delivery was driven back hard by Lyth for the bowler to pull off a brilliant catch diving to his left.
Borthwick remained in the thick of the action by throwing down the stumps to run out Oliver Robinson and the slide continued as Bairstow was caught by Breese at midwicket off Collingwood.
With panic setting in, Tim Bresnan was beaten by Stoneman's throw from cover and Borthwick was soon in the limelight again, catching Rashid at long on to bring Breese his wicket.
Pyrah and Rafiq started a mini-revival which ended with Pyrah being lbw to Hastings at 91, and there were 16 balls still remaining when Sidebottom was run out while he and Rafiq were considering a third run.