Liam Craig was the man on the spot as St Johnstone claimed a deserved 1-1 draw against Rangers after a double dose of penalty controversy in Perth.
Steven Gerrard's team thought they had warmed up for Sunday's Scottish Cup showdown by edging to a narrow win in their McDiarmid Park dress rehearsal following Scott Wright's first goal for the club.
But referee Euan Anderson – who had earlier performed a bizarre U-turn after overturning a Saints spot-kick award – did then hand the hosts a soft penalty in the third minute of stoppage time which Craig rammed home to seal a point.
It meant Callum Davidson's men cut the gap on Livingston and a potential European slot to three points with three games remaining.
Rangers will be frustrated at the slip-up but at least their quest for an unbeaten league campaign lived on.
And they will now turn their attention to doubling up on their league triumph when Saints travel to Glasgow for this weekend's last-eight duel.
Gerrard clearly had an eye on Sunday's quarter-final as he made seven changes to the team that dumped Celtic out of the last-16.
Skipper James Tavernier was back in a starting line-up for the first time since February after recovering from a knee injury while January signing Jack Simpson came in for his first start.
Saints rang the changes too as Zander Clark, Callum Booth, Ali McCann and Shaun Rooney returned for the Betfred Cup winners.
It was the newly crowned Premiership kings who started the shakier though as they survived an early onslaught.
Saints had tried a near-post corner routine three times without success during Saturday's cup win over Clyde.
That did not stop them dusting it off again inside the first three minutes as Stevie May flicked back David Wotherspoon's ball to the edge of the six-yard box but Craig shot straight at Jon McLaughlin.
Guy Melamed did have the ball in the net seconds later as he sneaked in behind Rangers' backline but the offside flag was up by the time he fired home.
The Israeli was soon forced off with a migraine but only after nodding another Wotherspoon out-swinger straight at the keeper while totally unmarked.
Rangers looked a shambles at the back, with Simpson forced to scramble back and cut out a May ball for Melamed as Connor Goldson screamed in vain for offside with just seven minutes played.
They were not much better going forward, with a wasted free Simpson header and a Wright chance following a sublime Kemar Roofe ball over the top the only notable openings they created in the entire opening half.
But they got their act together at the interval and grabbed the opener within 10 minutes of the restart.
Steven Davis got the benefit of the doubt as the ball appeared to brush his arm. The Northern Irishman slotted in Wright, who cut inside and swept a fine right-foot finish past Clark to open his Rangers account.
Saints were unhappy with the decision to play on and were even angrier three minutes later when Anderson pointed to the spot as Borna Barisic and Rooney clashed in the box – only to then change his mind.
The home captain was standing over the spot ready to shoot but was then left stunned as Anderson decided to award a goal-kick instead after consulting with Frank Connor.
Rangers thought they had seen out the danger as the clock ticked past 90 minutes.
But when Roofe tried another needlessly spectacular effort from the half-way line, it handed St Johnstone one last chance and they got their rewards when Simpson barged over Christopher Kane, with Craig making no mistake from 12 yards.