James Vaughan struck an 86th-minute winner as Huddersfield exacted revenge on their West Yorkshire rivals and dealt Leeds' npower Championship play-off hopes a major blow.
Vaughan kept his composure to steer home the winner from inside the penalty area after Leeds substitute Aidy White had cancelled out Neil Danns' opener for the visitors early in the second half.
It was a welcome victory for Huddersfield, beaten 4-2 by Leeds at the John Smith's Stadium in December, and lifted them eight points clear of the relegation zone.
Leeds' outside play-off chances appear to be fading fast as they slipped to their first home defeat since early February. They still trail sixth-placed Nottingham Forest by four points, having played a game more than all their rivals.
Leeds almost took the lead in the fourth minute when Luke Varney's goalbound header from Stephen Warnock's corner was headed off the line and up on to the crossbar by Huddersfield skipper Peter Clarke.
Huddersfield goalkeeper Alex Smithies then did superbly to keep out a low shot from El-Hadji Diouf, back in the starting line-up for the first time in seven matches, as Leeds looked to build up a head of steam.
The visitors withstood the early barrage and responded in style in the 21st minute when winger Danny Ward, making his first start since breaking a bone in his foot in December, clipped over a superb cross from the left and striker Vaughan headed against the bar.
Chances at either end dried up, though, as both sides lost their way, but Varney almost escaped the attention of Town defender Antony Gerrard in the visitors' area following Diouf's neat pass and Ward's header from Clayton's headed pass was brilliantly saved low down to his right by Leeds goalkeeper Paddy Kenny just before half-time.
Too many passes went astray after the restart to give the Elland Road crowd anything to shout about and it was Huddersfield who seized the initiative to claim a 54th-minute lead.
Huddersfield right-back Jack Hunt's cross was not properly cleared and, when Vaughan's ball back in was blocked, the Town striker was allowed to head the ball backward into the path of Danns, who volleyed his first goal for the club cleanly inside Kenny's near post.
Leeds boss Warnock sent on White and Ryan Hall for Paul Green and the ineffective Habib Habibou respectively and was almost instantly rewarded.
Home defender Tom Lees swung over a cross that eluded Town centre-half Clarke and White charged in at the far post to beat Hunt to the bouncing ball and steer his header over Smithies into the opposite corner.
Ward forced another decent save from Kenny minutes later with a crisp left-footed drive from the left edge of the area and Leeds defender Sam Byram headed Diouf's corner wide.
Huddersfield boss Mark Robins replaced midfielder Oliver Norwood and Ward with former Leeds striker Jermaine Beckford, making his first appearance since January due to a hamstring injury, and Sean Scannell in the 76th minute.
Leeds then went close to taking the lead in spectacular fashion when midfielder Rudy Austin's dipping 25-yard volley hit the bar and bounced down on to Smithies' back.
But it was Huddersfield who snatched all three points. Danns slipped the ball to young defender Hunt and, following his slide-rule pass into the area, Vaughan held his nerve to side-foot a neat finish beyond Kenny and inside the far post.