Sasa Papac came to Rangers' rescue with a late winner against St Johnstone to send the Scottish champions to the summit of the Clydesdale Bank Premier League.
The full-back picked the ideal time to net his first goal of the season when he grabbed the decider at McDiarmid Park after Kris Boyd had cancelled out Collin Samuel's opener.
The final result was a blow for a plucky Saints side who picked up their first SPL win last week and had looked set to claim their biggest scalp of the season.
There was mystery surrounding the Rangers team ahead of the game with Madjid Bougherra absent amid reports of being dropped after going AWOL while on international duty.
The defender - who missed the Old Firm derby with flu - helped Algeria to a win over Rwanda last weekend but was missing from training at Murray Park on Friday.
Pedro Mendes also failed to feature in the squad which made the trip to Perth, although Lee McCulloch, Kevin Thomson, Jerome Rothen and Kyle Lafferty were all drafted into the starting XI.
St Johnstone made three changes from the side which defeated Hamilton. Murray Davidson, Gavin Swankie and Samuel all started, while Liam Craig and Kenny Deuchar were dropped to the bench and Steven Milne missed out through injury.
Only the woodwork prevented St Johnstone taking a shock lead with just three minutes gone.
Samuel burst down the left flank before delivering a cross into the box for Martin Hardie, whose header cracked off Allan McGregor's right-hand post.
The home side had Rangers under pressure again when Swankie tried to set up Samuel for the header in front of goal but David Weir managed to intercept and clear the danger.
Rangers failed to heed the warning signs and found themselves trailing with 17 minutes gone when Samuel raced onto a superb ball from Davidson before bearing down on goal and doing well to keep his composure and slot under McGregor.
Walter Smith's men had the opportunity to equalise when Steven Whittaker was fouled just outside the box but Rothen's effort curled harmlessly wide, before Alan Main comfortably blocked a shot from the edge of the area from Lafferty.
Rangers claimed for handball when a Boyd ball came off David MacKay but the pleas were ignored by referee William Collum, who awarded a corner rather than a penalty.
But Rangers were back on level terms four minutes before the break anyway when a Thomson shot was inadvertently blocked by Papac and broke for Boyd to rifle home the rebound from eight yards.
Saints should have had the stuffing knocked out of them after conceding an equaliser but emerged for the second half determined to reclaim their advantage.
Chris Millar saw a 25-yard drive fizz past the post before Davidson squeezed between Weir and McCulloch and threw himself in front of a Hardie cross only to connect awkwardly and nod just wide.
Saints then passed up a great chance when Samuel rolled the ball to Davidson from the right but he left the ball for Millar, who was also fooled by the dummy, and his hesitation cost him the opportunity to find the back of the net.
St Johnstone appeared unwilling to settle for the point and could have snatched victory when Filipe Morais set up Samuel but his ferocious shot was blocked by the body of McGregor.
Rangers had already thrown Steven Naismith and Nacho Novo into the action and they were joined by Kenny Miller with less than 10 minutes to go in a desperate late push for a winner.
They did claim the decisive goal after 83 minutes but it came from an unusual source. Naismith provided the pass for Papac in plenty of space and he had time to switch from his right to his preferred left foot before lashing into the back of the net.
Teams
St Johnstone Main, MacKay, Anderson, Gartland, Grainger,Millar, Morris, Davidson, Swankie (Morais 62),Hardie (Craig 81), Samuel (Deuchar 81).
Subs Not Used: Smith, McCaffrey, May, Reynolds.
Booked: Millar.
Goals: Samuel 17.
Rangers McGregor, Whittaker, Weir, Papac, Smith (Naismith 61),Davis, Thomson, McCulloch, Rothen (Novo 74), Boyd (Miller 81),Lafferty.
Subs Not Used: Alexander, Fleck, Loy, McMillan.
Booked: McCulloch.
Goals: Boyd 40, Papac 83.
Att: 7,807
Ref: William Collum (Scotland).