Prior to this League Cup tie, Rangers had conquered all before them in the Championship well, they experienced a taste of their own medicine against a simply superb Saints at Ibrox.
Those heard-hearted assessors of sporting chance, the bookmakers, had decided before this game that despite the fact the men from Perth were playing in the top tier of the Scottish game, the home side were short-odds favourites.
That proved to be well wide of the mark with St Johnstone producing a pulsating display of power, pace and precision to march through to the quarter-finals.
Saints boss Tommy Wright made four changes from the team that was defeated at Kilmarnock at the weekend.
On-loan Celtic defender Darnell Fisher picked up an injury in that game and was not in the squad while Liam Craig, John Sutton and Graham Cummins dropped to the bench with Simon Lappin, Tam Scobbie, Murray Davidson and Steven MacLean being drafted in.
Rangers manager Mark Warburton made three changes from the team that won at Dumbarton on Saturday with Rob Kiernan, Jason Holt and Nathan Oduwa coming into the starting line-up, while Dominic Ball, Nicky Law and Barrie McKay dropped out.
Saints provided an early test for home keeper Wes Foderingham in just the fourth minute when a long Shaughnessy throw from the right was cleared to the edge of the Rangers box, falling nicely for Lappin whose well-hit shot was saved by the diving goalie at the expense of a corner.
As expected, there was also plenty of attacking intent in the early stages from Rangers with St Johnstone working hard to keep their shape and discipline.
The Rangers fans in the Broomloan Road stand thought their side should have had a penalty in the 14th minute when Oduwa went down under Dave Mackay’s sliding challenge inside the Saints box but referee Kevin Clancy did not agree and simply awarded a corner.
However, the home fans all around Ibrox were left stunned when St Johnstone took the lead in the 18th minute.
Michael O’Halloran burst down the right before cutting the ball inside to MacLean who produced a cheeky back-heel into the path of Murray Davidson who gleefully shot home from close range.
MacLean really should have made it two just four minutes later with O’Halloran again playing a superb ball in from the right but the former Rangers striker scooped the ball over the bar with the goal at his mercy.
Saints keeper Alan Mannus then had to look lively in the 26th minute to block a Kenny Miller snap shot.
If the home fans had been taken aback by the St Johnstone opener, there was a palpable sense of disbelief around Ibrox when Wright’s men made it two in the 29th minute.
David Wotherspoon played a corner from the left direct to Lappin lurking unmarked on the edge of the Rangers box and he sent a sweet left-foot shot past the despairing diving Foderingham to make it 2-0 for the Perth men.
The Light Blues looked to respond but the half ended with St Johnstone deservedly in front.
Saints would have been expecting a Rangers backlash at the start of the second half instead, Wright’s men were in dreamland just seconds after the restart.
MacLean hit a ball over the top to O’Halloran who turned on the after-burners to outpace two Rangers defenders before keeping his cool to fire past the shell-shocked Foderingham to make it 3-0.
St Johnstone did though have a let-off in the 55th minute when the dangerous Oduwa burst into their penalty area with his shot clipping the top of Mannus’s crossbar.
However, the keeper was helpless to prevent Rangers pulling one back in the 62nd minute when James Tavernier skipped into the Saints box before lashing an unstoppable shot high past Mannus.
Rangers tails were up and they really should have scored another shortly after but Martyn Waghorn directed his header wide when he should have at least hit the target.
The Light Blues then started to turn the screw with St Johnstone having to defend manfully.
In truth, Saints were probably having to soak up more pressure than Wright would have liked.
However, in the 86th minute they came close to snatching a third when Cummins headed a Craig cross just wide.
Ultimately, it didn’t matter with the Saints fans inside Ibrox wildly celebrating a memorable victory at the final whistle.
Attendance 27,094.
Rangers Foderingham, Tavernier, Kiernan, Wallace, Zelalem (Law, 75), Miller, Oduwa, Halliday (McKay, 75), Holt (Shiels, 53), Wilson, Waghorn.
Subs not used Kelly, Ball, Aird, Hardie.
St Johnstone Mannus, Mackay, Scobbie, Lappin (Craig, 67), Millar, Davidson, MacLean, Wotherspoon, Shaughnessy, Easton, O’Halloran (Cummins, 72).
Subs not used Clark, Anderson, Sutton, McKay, Caddis.
Referee Kevin Clancy.