IF York City Knights had performed at Leigh Sports Village anything like they had in their last few outings, they would now be looking forward to a Challenge Cup fifth-round tie with real hopes of reaching the quarter-finals for the first time since 2004.

That their winning start to 2014 instead ended came down to mad moments late in each half - conceding three tries in six minutes in the first, and a bit of foolhardiness from, of all people, assistant-coach James Ford in the second.

The penalty he conceded with extra time looming, heartbreaking after a brave fightback, was dispatched by Jacque Peet, and a drop goal by stand-off Chris Atkin confirmed it would be hosts Swinton going into the hat and coming out with a winnable home tie against Paul March's inconsistent Keighley Cougars.

That game-breaking 77th-minute penalty came after skipper Jack Lee, of all people, had been penalised for a forward pass. In the Swinton attack that followed, Ford held on to a dangling leg to slow down a play-the-ball, and, while it was hardly a bad foul, it was enough to give referee Jamie Bloem an opportunity to blow for a penalty.

Those late points gave the Lions a 31-28 win at the end of a scrappy but gripping tie which could have gone either way had either team taken it by the scruff of the neck.

They would have been particularly galling for Ford as, earlier in the half, he'd been clobbered around the head by a Joe Worthington tackle which, on another day, would have brought a red card but, according to Bloem, a hard man in his playing days, merited only a free-kick out of shooting range.

The last of Swinton's five tries was also controversial - Bloem overruling a touch judge to award them a touchdown.

Nonetheless, as boss Gary Thornton alluded to, the Knights could have won regardless - had they got out of neutral in the first half, or had they played like they did against Whitehaven in round three.

They might again have been underdogs as the team from the lower tier, but Swinton were not at their strongest and appeared there for the taking.

Josh Barlow failed a head test, Mark Thomas withdrew as his wife gave birth, and, of their Warrington Wolves contingent, only season-long loanees Andy Ackers and Peet were allowed to turn out.

Veteran points machine Mick Nanyn was a non-playing substitute, while winger Freddie Walker joined the injury list four minutes into the match.

The Knights had also enjoyed a great start, scoring after 60 seconds as Lions player-coach Ian Watson fumbled the kick-off and, following the scrum, Lee got over from dummy-half.

However, that opening try perhaps lulled York in.

The early loss of Jason Golden, followed later into the treatment room by Iain Morrison, also disrupted them.

Moreover, it was they who were making the more obvious errors.

Swinton, bigger in the pack and stronger in the ruck, duly eked control and equalised after the first of several errors - dropping a simple pass inside his own 20 - by winger George Elliott. Dangerman Darren Hawkyard took the chance, with Peet adding his first of four conversions.

Kash Watkins, after another Elliot fumble, and Ackers, after penalties conceded by Ford and Iain Morrison, both lost control over the whitewash as the Lions were gifted more opportunities.

York rarely completed first-half sets but, on a rare occasion they had possession in home territory, they again scored - Lee Paterson, on his 200th domestic appearance, dummied over from dummy-half.

However, a Morrison fumble halted momentum and preceded Swinton's decisive three-try spell.

This saw touchdowns for Watkins and Peet - both down York's right edge as Elliott was drawn into no man’s land due to lack of numbers - and Hawkyard, down the other flank, following a good kick return by brother Ritchie.

The Knights remained in neutral - until substitute Benn Hardcastle, included for his match-turning qualities, scored a try out of nothing eight minutes after the interval.

He had few last-tackle options so dabbed a kick through and bravely got onto it himself.

York were re-energised. Worthington’s head-high shot on Ford was punished by a Pat Smith try – gleefully darting to the sticks after his kick had ricocheted back to him - and James Haynes added his fourth conversion to put York 24-22 up, despite their hit-and-miss display.

However, then came the sucker punch. Elliott was seemingly obstructed underneath a Watson kick and the loose ball fell to Chris Atkin, who, from a distance, appeared to bounce the ball down. A touch judge said no try, the referee said try.

York got some refund when Austin Bell lost the ball in front of Swinton’s sticks with home full-back Ritchie Hawkyard having a clear run to the other end. Bloem this time listened to his assistant and awarded a penalty for reefing.

From it, Ford gave Ben Dent an easy equalising try.

Hardcastle, with eight minutes left, took over kicking duties but his touchline conversion drifted wide.

And it was Swinton who won it with the boot.

Match facts

Swinton: R Hawkyard, Warrilow, Peet, Halliwell, Walker, Atkin, Watson, Menzies, Ackers, M Morrison, Watkins, D Hawkyard, Brown. Subs (all used): Hulme, Johnson, Worthington, Nanyn.

Tries: D Hawkyard 14, 39; Watkins 33; Peet 35; Atkin 61.

Conversions: Peet 14, 35, 39, 61.

Penalties: Peet 77.

Drop-goal: Atkin 79.

Sent off: none.

Sin-binned: none.

York: Haynes 6, Elliott 4, Ford 5, Morland 5, B Dent 6, P Smith 6, Presley 6, Bell 6, Lee 8, Aldous 7, Golden 5, E Smith 7, Paterson 6. Subs (all used): B Hardcastle 7, Mallinder 7, I Morrison 5, Joynt 6.

Tries: Lee 1; Paterson 26; Hardcastle 48, P Smith 54, B Dent 72.

Conversions: Haynes 1, 26, 48, 54.

Penalties: none.

Sent off: none.

Sin-binned: none.

Man of the match: Jack Lee – the hooker worked hard with and without the ball and showed quality throughout... marred only when he was called for a forward pass late on which preceded Swinton’s match-winning penalty.

Referee: Jamie Bloem (Halifax) – both sets of fans were complaining at various points, and the contingent from York had more reason to be unhappy.

Penalties: 7-8.

Half-time: 22-12.

Attendance: 427.

Weather: light showers.

Moment of the match: Benn Hardcastle’s try underlined the half-back’s ability to create something out of nothing.

Gaffe of the match: York’s first half had been littered with mistakes. The biggest error, though, came at the end of the second half – James Ford interfering at the play-the-ball, giving Jacque Peet an easy chance to kick the decisive penalty with three minutes to go.

Gamebreaker: that Peet penalty.

Match rating: scrappy first half turned into a tense, thrilling cup tie in the second. York will feel they would have won if just a little bit nearer their best.