Leeds Rhinos 14 Castleford Tigers 8: Rohan Smith's side produce stirring comeback to book play-off spot
The Rhinos have produced some scintillating rugby since Rohan Smith's arrival in May but they slipped into bad habits for large parts of a low-quality game.
With their season on the line, Leeds rediscovered their mojo to deny Castleford a famous win and end their rivals’ campaign.
Smith's side have played better and lost this year but they deserve credit for digging deep into their physical and mental reserves with their title hopes fading fast.
After a drab first half, the resolute Tigers took an 8-0 lead into the final eight minutes to put one foot in the play-offs.
But a stirring late comeback sent Castleford on holiday and Leeds to Catalans Dragons for an eliminator next Friday.
Aidan Sezer, the hero the last time the Rhinos won in Perpignan in July, scored the winning try again in the final minute after Kruise Leeming had wiped out the deficit.
Leeds will need to improve out of sight to challenge Catalans but a fifth-place finish evokes memories of the back-to-back title runs in 2011 and 2012.
To reach a first Grand Final in five years, the Rhinos must take their Headingley form on the road.
Leeds ended the regular season on a nine-match unbeaten run at home, including eight straight wins.
A top-six finish completes a remarkable turnaround since the nadir of their season, a 40-16 home defeat by Castleford in the Challenge Cup in March.
Jamie Jones-Buchanan steadied the ship and Smith has gone on to transform the club's fortunes.
After being billed by Leeds as the most important game at Headingley since 2017, the first half was a contender for the worst in that time.
While Castleford could point to an injury crisis that left them without any fit half-backs, the Rhinos had no such excuse after naming arguably their strongest line-up of the season.
Nerves were understandable in the biggest game of the campaign and there was an element of fatigue at the end of a gruelling period - but there could be no justification for the sheer number of first-half errors.
By the interval, Leeds must have been rueing turning down two kickable penalties in the early stages.
The Rhinos were understandably keen to put the Tigers under the pump having seen Salford Red Devils blow them off the park only days earlier but they lacked composure in key areas.
Leeds' best chance came and went when Ash Handley was forced into an error after being crowded out in the corner.
The Rhinos spent much of the half in Castleford territory yet rarely completed a set, let alone carve out a clear-cut opportunity.
Mikolaj Oledzki tried to get his side going with a barnstorming run and then found himself on the receiving end of a late hit by Suaia Matagi.
The tackle earned the Tigers prop 10 minutes in the sin bin but Castleford were in no mood to let Leeds in.
After being asked by Lee Radford to go down swinging, the Tigers were doing everything that had been asked of them.
Castleford rarely threatened in the first period, although they did show flickers of life in an attacking sense.
Jake Mamo was pulled back for an obstruction as he threatened to go in under the posts and Mahe Fonua was held up over the line in a strong finish to the half by the Tigers.
After seeing the influential Handley forced off at the interval, Castleford seized the moment to take control of the contest.
Paul McShane got the scoreboard ticking with a penalty from an acute angle and from the restart Mamo sent the travelling supporters into raptures.
Joe Westerman poked his nose through the line and the supporting Mamo had too much speed for Richie Myler.
Sensing the season was slipping away, the home fans did their best to get their side going and the Rhinos responded.
There was a feeling that the last chance had gone when Zak Hardaker had the ball knocked from his grasp close to the line - but the momentum was with the Rhinos and Castleford were unable to weather the storm.
It was not for the want of trying, Mamo and Cain Robb producing vital tackles to deny Myler.
Trailing by eight points in the 73rd minute, Leeds showed smarts under pressure to take the two from a penalty through Rhyse Martin to leave themselves one score behind.
With the Tigers on the ropes, Hardaker found a hole in Castleford's right edge on a kick return and Leeming was in support to finish.
Martin added the extras to draw the Rhinos level and, after Greg Eden missed with a drop-goal attempt, the roof came off Headingley.
The tireless Oledzki - in his 27th consecutive appearance of the season - found enough energy to make a burst and offload to Myler who gave Sezer the glory in a memorable finish.
Leeds Rhinos: Myler, Briscoe, Hardaker, L Sutcliffe, Handley, Austin, Sezer, Oledzki, Leeming, Prior, Bentley, Martin, Tetevano.
Substitutes: Dwyer, Gannon, O'Connor, C Smith.
Castleford Tigers: Mamo, Faraimo, A Sutcliffe, Fonua, Olpherts, Eden, McShane, Griffin, Milner, Matagi, Lawler, Mellor, Westerman.
Substitutes: D Smith, Martin, Hall, Robb.
Referee: Ben Thaler.