Harlequins saw their play-off hopes all but disappear as they conceded two tries in the last six minutes of a game they seemed to have wrapped up.
The London side would have gone seventh in Super League had they won and that is what they appeared to have done when the highly rated prop Louie McCarthy-Scarsbrook set up a try and scored another in the second half. But Salford's slightly less highly regarded prop, Steve Nash, came up with the plays that gave his side a rare away win.
That makes it eight defeats in nine for Quins, whose coach, Brian McDermott, said that the play-offs were the least of his concerns.
"If we get there, very good," he said. "But if we play like that, I don't think we'll get there and I don't want to be there."
Salford, who were without Richie Myler - who has an achilles injury - took the lead with a messy try. Stefan Ratchford put a kick into the in-goal area, Jon Wells and Chris Melling could not tidy it up and John Wilshere was credited with the touch down.
From that unpromising start, Quins seemed to be taking some sort of control. A penalty against Jeremy Smith, for offside, helped them mount some pressure and Luke Dorn went over against his old club. Five minutes later, Chad Randall burrowed over from dummy-half.
All that good work was undone in the minutes before half-time, though, as Quins presented Salford with two tries and the lead. Adam Sidlow's pass off the ground put the visitors in an attacking position but there was no excuse for the way Quins eagerly bought the most extravagant dummy from the veteran Robbie Paul to leave Wilshere unmarked for his second. Two minutes before the break, Dorn threw what could be described politely as a speculative pass and Dean McGilvray picked it off to go 80 metres for a third Salford try.
The Croydon-born McCarthy-Scarsbrook showed why he is seen as such a great prospect after the break. He slipped a pass to Rob Purdham for one try and stormed through from 40m for another. Unfortunately, his team-mates thought that meant the job was done. Nash wrestled his way over for a try and then, with time running out, managed to slip the ball out of a three-man tackle to Malcolm Alker, who allowed Luke Swain to exploit a gap to the right of the sticks.
"I thought we deserved to win," said the Salford coach, Shaun McRae. "Steve Nash has been good since he came into the side, he was involved in both those tries and he has taken his chance."
Harlequins: Melling; Wells, Gafa, Clubb, Sharp; Dorn, Gale; Ward, Randall, McCarthy-Scarsbrook, Williamson, Golden, Purdham. Substitutes used: Heckenberg, Kaye, Haggerty, Bryan.
Salford: Fitzpatrick; McGilvray, Littler, Henry, Wilshere; Smith, Ratchford; Cashmere, Alker, Leuluai, Sibbit, Adamson, Swain. Substitutes used: Paul, Walton, Sidlow, Nash.
Referee: T Alibert (France).