Rhinos trailed 14-0 for most of the second half and only got their attacking game together when it was too late.
It was the fifth time Rhinos have lost on goal kicks this season. Both teams scored two their tries, Leeds’ coming in a three-minute spell in the final 10.
Keith Galloway barged over on 74 to avoid Leeds’ first whitewash since 1998, Zak Hardaker converting and then Ashton Golding also crossed.
It was a thrilling finish, but Leeds paid the price for a dire attacking display for most of the match.
They trailed 8-0 at the interval, which was the sixth time they have failed to score in a half this year.
Salford increased their lead just four minutes into the second half – to go three scores clear – and that was just enough to see them through.
The visitors had enough pressure on Reds’ line, but their attacking options were poor, though Kallum Watkins and Brad Singleton both had possible touchdowns ruled out before the late burst.
There was just one try in the opening half, but it was a poor one for Leeds to concede. Salford had two serious attacks and in the first, after 24 minutes, Logan Tomkins picked up from acting half, had a run and dived over the line.
Gareth O’Brien converted and then Michael Dobson made it 8-0 with a penalty after Hardaker had allowed a towering kick to bounce.
Salford’s only other opportunity of the opening period came in the final seconds when Justin Carney went on a barnstorming run, but Leeds managed to hold out.
Rhinos forced three drop out and had three successive penalties towards the end of the half, but never looked like finding a way through, though Beau Falloon did go close from acting-half.
Early in the second half Robert Lui kicked a 40-20 and then dummied over from the scrum, Dobson’s conversion making it 14-0.
Watkins was held up over the line after Rob Burrow’s run and then Burrow’s sent Singleton crashing through, but he was ruled to have knocked-on.
The two late tries gave Leeds - who had nine players on their injury lit - something to build on, but they remain second bottom. It was their defeat at Salford since 1993 and only the second time they have lost to them in Super League.