IT ain’t over ‘til it’s over. On the day of his sad passing, how apt that Hearts would take one of baseball legend Yogi Berra’s most famous utterings and put it into practise. Trailing 2-1 as the Rugby Park clock moved on to the 90th minute, Robbie Neilson's side found a leveller through substitute Juanma and then, remarkably, a winner from Sam Nicholson just as extra-time in this League Cup last 16 tie looked inevitable. Kilmarnock, looking in good shape to record a third successive victory on the back of two Josh Magennis goals, seemed suitably stunned.

Hearts, though, really needed this one. A strong start to the season had given way to three successive defeats and another loss would have had some starting to question whether everything was still running smoothly down Tynecastle way. This, then, was the best way to allay any criticism and had the effect of sending Hearts into Monday’s draw for the quarter-finals.

They had to do it the hard way, however. Kilmarnock, with their coterie of former Jambos strewn throughout the team and on the bench, looked well up for this one. They went in front after just 13 minutes through the impressive Magennis, suffered the anguish of being pegged back through Alim Ozturk’s driven effort, before conjuring what looked like a winner through Magennis with 11 minutes to go. Hearts, though, had other ideas, Juanma heading in Jamie Walker’s cross, before a scuffed shot from the Spaniard fell kindly for Nicholson who rammed in his effort in front of the delirious travelling fans. The prospect of another defeat or - perhaps worse - a draining stint of extra-time ahead of a visit to Celtic Park on Saturday was the last thing Neilson wanted and his players spared him on both fronts.

“We shouldn’t be coming to Rugby Park and having to score three goals to win but to get the third goal was fantastic and it showed great spirit,” said the head coach. “It helps us a little bit going to Parkhead on Saturday and we didn’t have extra time which was always the worry.”

That Kilmarnock were still applauded off the pitch by many of their supporters spoke of an appreciation for their efforts that had somehow gone unrewarded. On the back of two successive league wins, Gary Locke cut a frustrated figure at his side’s failure to make it three-in-a-row.

“I’m gutted,” said the former Hearts manager. “We put so much into the game so to lose a couple of late goals is a sickener for us. I thought at 2-1 we looked comfortable.”

Locke had added to his army of ex-Jambos the previous day with goalkeeper Mark Ridgers recruited on an emergency loan from St Mirren. With Jamie MacDonald in with a chance of being fit again for Saturday’s game against Hamilton Accies, this may prove to be Ridgers’ sole performance in a Kilmarnock shirt and he at least made his mark with some decent saves while being largely blameless for any of the three Hearts goals.

KILMARNOCK (4-2-3-1): Ridgers; O’Hara, Ashcroft, Balatoni, Findlay (Smith 26); Slater, Hamill; Kiltie (Boyd 84), Higginbotham, Obadeyi (Robinson 72); Magennis

Booked: Magennis 39, Smith 45, Slater 62

Scorers: Magennis 13

HEARTS (4-2-3-1): Alexander; Paterson, Augustyn, Ozturk, Rossi; Buaben, Gomis; King (Walker 52), Swanson (Juanma 57), Nicholson; Sow

Booked: Augustyn 42, Buaben 60

Scorers: Ozturk 74, Juanma 90, Nicholson 90+2

Ref: Craig Thomson