After a sluggish start where they looked to still be suffering from a semi-final hangover and during which they lost Graham Dorrans to injury, Rangers eased ahead just before the break through Jason Holt’s first goal in over a year.

But their lumbering, pace-less football ensured that Kilmarnock were never quite out of it – and they struck four minutes into stoppage time to stun Caixinha and pile the pressure on him.

In those scenes of mayhem at the end, first ref Alan Muir awarded Rangers a penalty for Kirk Broadfoot’s foul on Eduardo Herrera – though he had to debate it with his assistant Jordan Stokoe before confirming it. While that was going on, Broadfoot and Ryan Jack clashed, with both being booked.

Daniel Candeias eventually took the penalty and saw it saved by Jamie MacDonald – but then fourth official Scott Millar alerted Muir to the severity of Jack’s involvement in the Broadfoot incident and he was shown a red card.

When James Tavernier squandered possession in midfield, Jones accelerated clear and touched the ball infield to Greg Taylor, who should have done better than send a tame drive into the arms of Foderingham.

As what had been a scrappy first-half drew to a close Rangers began to exert some authority.

A neat bit of interplay on the left ended with Herrera’s crisp pass putting Josh Windass in on goal and Jamie MacDonald reacted smartly to block his left-foot drive.

Windass ballooned a drive over the top, but Rangers were building up a head of steam and just as Kilmarnock thought they’d go in level at the break, they went in front two minutes before half-time.

O’Donnell, surging into the box to get on the end of a rippling passing move, was next to test the home defence with a low drive as the Rangers support grew more edgy at the way the visitors had seized the initiative.

There were more grumbles as another sub, Chris Burke, fired in a cross which was met by McKenzie again, with Foderingham being forced to make the save.

But Rangers appeared to have made it through the night unscathed – until Burke struck to round off that amazing ending.