York survived a bruising encounter to clinch third place in Championship One with two tries in the last five minutes.
York started brightly with Jordan Ross crossing the line after only three minutes after collecting a superb one-handed pass from Tom Haberecht. But scrum-half Gary Hulse moved Swinton around with an easy cohesion and from his superb break Neil Rigby
was just held on his back over the try line.
Swinton equalised as Hulse's long ball enabled Carl Sneyd to run in unopposed although York hit back with three converted tries. Lee Waterman carried on Richard Blakeway's break from his own half before releasing Loz Wildbore to score, Ross skipped through the defence to touch down and Gareth Moore's 45-metre break was finished with aplomb by Danny Ratcliffe.
But the Lions hit back after the break with two quick tries as Andy Saywell scored in the corner followed by Craig Ashall.
John Oakes's try after a superb offload from David March restored York's lead but again the Lions responded as Sneyd provided a second try for Saywell.
York's Mark Applegarth touched down another kick through only for Lions' Darren Bamford to collect a loose kick from Wildbore and outpace the defence over 60 metres and touch down.
Two tries in the last five minutes from Ratcliffe and Wildbore finally secured a hard fought York victory.
York: Ratcliffe, Waterman, Oakes, Haberecht, Clayton, Wildbore, Moore, Applegarth, Hughes, Hesketh, Ross, Blakeway, March. Substitutes: Mitchell, Clough, Sullivan, Ambler,
Swinton Lions: Bamford, Saywell, D Hull, Sneyd Lopag, C Hull, Hulse, Hayes, Hawkyard, Heaton, Newton, Rigby, Ashall. Substitutes: Crook, Moana, Tyrer, Johnson
Referee: G Dolan (Dewsbury).