The Rhinos were heading for a fourth straight defeat - and an away semi-final - after Huddersfield established a 16-8 lead but they stormed back with 12 points in the last seven minutes to claim an unlikely 20-16 victory.
Right winger Tom Briscoe, Leeds’ five-try hero at Wembley, handed his side a lifeline with a 74th-minute score while left winger Ryan Hall grabbed the winner in the last move of an epic game.
It means the Rhinos, two-thirds of the way towards completing the treble, will host St Helens in the second semi-final next Friday while Wigan, who lost out in the battle for top spot despite a 47-12 win over Castleford, play Huddersfield at the DW Stadium on Thursday.
Boss Brian McDermott said: “Over the duration of the season, I reckon we’ve been the best team, only by a cigarette paper’s width.
“I don’t think we’ve been a long way in front of everybody, I think Wigan have been a good team and so have Huddersfield and Saints are a very tenacious team who won’t go away.
“I am happy we are league leaders and I don’t have a problem with the way we did it, because during my time as Leeds coach we’ve been on the end of some tough finishes.
“I thought the game was dead and buried with 10 minutes to go, I didn’t think we could turn that scoreline around.”