Oldham went agonisingly close to breaking their sequence of third-tier play-off final defeats in a thriller at Warrington.
Seemingly dead and buried when they were 12 points down with less than five minutes to play, the Roughyeds showed their determination to push for promotion with storming tries by Luke Menzies and Wayne Kerr.
They would have taken the match into extra time but for Chris Baines missing an easy conversion to Menzies' try. That was how narrow the gap between success and failure turned out to be in a compelling contest.
Oldham had their noses in front at half-time through Menzies' converted first try outweighing one from Sam Gardner, but soon lost their way.
Keighley's Danny Jones, the only player in the country to play and score in every game this season, kept that record going in emphatic style, with two tries, both of which he converted.
Neil Roden got one back for Oldham, but Jon Presley – Jones' equally impressive half-back partner – and Oliver Pursglove kept Keighley in command.
But then Thomas Coyle's long pass put Lee St Hilaire over to give Oldham a ray of hope and, with Jones in the sin-bin, they staged a grandstand finish.
Baines' miss, however, left them in the lower division at the end of a turbulent season, while Keighley go up into the Championship in the company of the unbeaten and already promoted Dewsbury.
That is an achievement that requires no spin, even from Alastair Campbell, there at the Halliwell Jones Stadium to support his home-town club.
Keighley: Rayner; Gardner, Potter, Pursglove, Duffy; Presley, Jones; Law, Wray, Shickell, Cartledge, Nicholson, Hughes. Substitutes used: Smith, Feather, Benjafield, Rawlins.
Oldham: Reilly; Onyango, St Hilaire, Joseph, O'Connor; N Roden, Coyle; Boults, M Roden, Kerr, Baines, Goulden, Lawton. Substitutes used: I'Anson, Menzies, Ashe, Heaton.
Referee: R Laughton (Barnsley).