James Tavernier's stunning goal with 10 minutes remaining gave Rangers a hard-fought win against St Johnstone and moved them to the summit of the Scottish Premiership.
The champions toiled in the first half, and fell behind to Michael O'Halloran's fine strike early in the second half as St Johnstone put in a typically resilient display.
But Kemar Roofe's penalty and Tavernier's sensational 25-yard effort capped an important turnaround for Steven Gerrard's side.
It moves them two points clear of Hibernian and Hearts, who face each other in the first Edinburgh derby of the season on Sunday.
St Johnstone, meanwhile, are still without a league win this season, though they were boosted before the match by news of manager Callum Davidson extending his contract to 2025.
After a stuttering start to the season, Old Firm victory against Celtic before the international break was the spark Rangers were looking for to ignite their campaign.
But a slow, error-strewn first half was a return to previously stilted displays, and it took going behind early in the second half to bring Gerrard's team to life.
St Johnstone - in their first game since losing key players Jason Kerr and Ali McCann on deadline day - were typically excellent without the ball, and O'Halloran provided the perfect sucker punch to match.
Hayden Muller's terrific pass from deep found the former Rangers forward and he controlled the ball and cut inside a flailing Filip Helander before firing past Jon McLaughlin.
The blow seemed to shake Rangers - without self-isolating centre-back Connor Goldson for the first time in 82 games - awake and Ryan Kent, who was again below his best to this point, dribbled into the box, and delayed his shot enough to entice Muller to catch his left leg.
Roofe was emphatic from the spot to level, and the furore after the ball hit the back of the net cranked up the intensity further.
St Johnstone captain Liam Craig tried to wrestle the ball from Roofe, Alfredo Morelos gave him a slight nudge, and then Shaun Rooney got involved in the melee as all four players were booked.
The Rangers fans behind either goal responded to that flurry of action, and their team showed the kind of intensity which had been sorely lacking in the first half.
Tavernier and Kent both flashed shots just over, and Roofe began causing problems for St Johnstone's back three, before the captain stepped up.
The right-back was missing for the win against Celtic due to Covid-19 isolation, and had failed to recapture his incredible form of last season.
But his intervention in Perth was magnificent, as he stepped on to Kent's pass and sent the ball looping over Zander Clark and into the corner to ultimately earn an important three points.
St Johnstone did not fold easily, though, and had efforts themselves, the best of them falling to new signing Ali Crawford, but Tavernier did enough to force him into side-footing over the bar from close range.
What did we learn?
Like last season, Rangers found a way to win a tough match when not at their best. Until they scored, St Johnstone managed to frustrate their visitors but it was startling how the intensity of the entire match went up in the aftermath of Roofe's equaliser.
The fans roared, Kent came to the party, and Tavernier produced the type of match-winning contribution he delivered regularly last term.
The key for Rangers now is to start producing 90-minute performances, which have so far eluded them. But, while they iron out some creases in their play, finding a way to win is the key and they did that well.
St Johnstone, meanwhile, were shorn of Liam Gordon and Murray Davidson, as well as having to cope with the departures of Kerr and McCann. What's key, though, is that whoever steps in, their 5-2-1-2 shape is honed perfectly.
They are incredibly hard to score against, and if they can add a bit more in the final third they will have a fine league campaign once more. Despite a winless start, there will be no panic with Davidson in charge.
What's next?
Rangers begin their Europa League group stage campaign at home to Lyon on Thursday (20:00 BST), while St Johnstone are back in action at Aberdeen in the Premiership next Saturday (15:00).