Hull bounced back from their derby humiliation to pull off a shock win at Headingley and ensure the Super League leaders' shield remained with St Helens.
Leeds, who faded badly after taking a 6-0 lead, cannot now catch Saints and need a point from their final match of the regular season against Wakefield next Friday to hold onto second place.
Australian scrum-half Matthew Head, whose arrival two months ago sparked an upturn in Hull's flagging fortunes, was the architect of a superb victory which should clinch a fourth-place finish and keeps alive their hopes of a second successive Grand Final appearance.
Hull coach Peter Sharp was embarrassed by his side's 42-6 home defeat by Hull KR last Sunday but he was beaming with pride after they redeemed themselves with an heroic defensive effort.
They scored their first two tries in a glorious five-minute spell just before half-time to grab the lead after Leeds forward Carl Ablett had opened the scoring with his first Super League try.
The flurry of points followed a bruising first half-hour dominated by aggressive defence in the penultimate round of the regular Super League season.
Leeds made most of the running as Hull conceded a series of handling errors and penalties.
One of the penalties was awarded against former Leeds prop Garreth Carvell, who was placed on report after only two minutes for an ugly off-the-ball challenge on hooker Matt Diskin.
It was all Leeds in the opening quarter, with full-back Brent Webb making his presence felt on his return from a three-match ban and stand-off Danny McGuire also causing problems for the visitors defence with his probing runs.
The best chance was created by centre Keith Senior, who broke clear but his final pass to Scott Donald only found Hull winger Craig Hall.
A strong kicking game from both teams ensured play went from end to end, even if it remained scrappy, and it took almost half an hour for the first points to come.
Substitute Ablett scored with his first touch of the ball, following up a kick from Rob Burrow that was cruelly deflected away from full-back Shaun Briscoe by Danny Washbrook.
Kevin Sinfield's conversion made it 6-0 but Hull response's was swift and emphatic, aided by a knock-on from their former player Jamie Thackray which put Leeds under pressure.
Hooker Wayne Godwin, making his return from a broken foot, caught the Rhinos defence napping at the play-the-ball to force his way over and Danny Tickle's goal levelled the scores.
Hull then struck again when winger Gareth Raynor collected Head's kick and touched down in spectacular fashion just before Webb's valiant tackle took him into touch.
The visitors almost scored a third try when second rower Willie Manu burst clear only to send out a poor pass, much to the relief of the 17,424 Headingley crowd.
Leeds thought they had equalised six minutes into the second half when Senior touched down at the corner but referee Richard Silverwood had his doubts and video official Ian Smith disallowed the try, ruling that Gareth Ellis had passed off the ground earlier in the move.
That was the signal for Hull to step up a gear and superb kicks from the skilful Head twice forced Leeds to concede goal-line drop-outs.
A handling error from Raynor gave Leeds a perfect attacking position but Hull centre Richard Whiting pulled off a timely interception to relieve the pressure.
He went 40 metres after snaffling Burrow's pass before being eventually tracked down by Leeds speed merchant Scott Donald and, when the Rhinos were pulled up for not being square the play-the-ball, Tickle extended his side's lead to 12-6 with a penalty.
Head then made sure of the win with a neat drop goal on 64 minutes before Raynor grabbed his second try deep into injury time.