Ben Roberts struck a late drop-goal as Castleford Tigers condemned Leeds Rhinos to their third defeat in a row and dented their hopes of winning the league leaders shield this evening.
The Rhinos fell behind at Headingley after a break allowed Andy Lynch to suck in defenders before offloading to Luke Gale, who scored in the corner and added the extras with a conversion.
Leeds, who were thrashed 46-16 by Catalans Dragons last weekend and haven't won since the record-breaking Challenge Cup final win over Hull KR, conceded another try as Denny Solomona managed to cross over for Cas.
However, Brian McDermott's men pulled a try back on 12 minutes after Ryan Hall scored, before Joel Moon went over the whitewash to level the scores.
The hosts thought that they had scored in the corner through Zak Hardaker to take the lead, but it was ruled out for obstruction in the build-up.
Leeds finally edged in front just before the half-hour mark as Hall received the ball only a few metres out and the England international held off two tacklers to score.
Darryl Powell's side reached half time on level terms as Luke Dorn crossed over, but the back looked slightly surprised at being awarded the points after the TV official decided that no obstruction had occurred prior to his try.
However, Cas scored two converted tries in nine second-half minutes as they looked to secure a top-five finish for only the fourth time in the era of summer rugby league.
The first came after a line break from Matt Cook before the replacement supplied Luke Gale for his second try of the evening and his quick hands teed up Roberts to touch down.
Leeds immediately responded through prop Adam Cuthbertson, but Roberts's drop-goal in the dying stages proved enough for the Tigers.