Rangers' perfect Championship record was hanging by a thread until Martyn Waghorn's last-minute winner against Queen of the South preserved it.
Sixty seconds after having a penalty saved by the outstanding Doonhamers' goalkeeper, Robbie Thomson, Waghorn's near-post header stole the points.
Derek Lyle had given the visitors a first-half lead that stunned Ibrox.
That silence transformed to rowdiness when Jason Holt equalised from a tight angle.
It is 15 goals in all competitions this season now for flexible forward Waghorn and it ensured Rangers made it 10 league wins in a row in the Championship.
Amazingly, it was also the first headed goal of manager Mark Warburton's reign at the club.
Queens make their mark
Initially all the signs were good for Rangers, who had Dom Ball deputising at centre-back for the injured Danny Wilson, and the Spurs loanee settled down early with a lovely long diagonal pass that found Barrie McKay on the left wing.
McKay was in menacing mood in the first 20 minutes, troubling Doonhamers right-back Kyle Jacobs on a few occasions - the highlight of which was a neat nutmeg on the visiting defender.
Kenny Miller, starting in place of Nathan Oduwa who had been in Germany on England Under-20 duty, benefitted from some good McKay work on the left but the striker blazed over from 10 yards.
Queen of the South's speedy on-loan Hibernian winger Alex Harris put a close low shot just wide of the far post before Waghorn re-asserted Rangers' authority with a curling effort, which Thomson palmed away.
This provided inspiration for the visitors to take a shock lead and turn the tide of the first half.
Lyle was not left with much to do when Ryan Conroy's corner was headed into his path by Chris Higgins to side-foot past Wes Foderingham from six yards.
After that, a previously shaky Jacobs looked solid, as did his team-mates as they stroked the ball about with ease until referee Barry Cook's half-time whistle.
As expected, the hosts piled on the pressure immediately after the break; Tavernier narrowly missing with one of his trademark free-kicks and Waghorn drawing another brilliant save from Thomson.
Pressure pays off for Rangers, eventually
The Doonhamers keeper did not deserve to be picking the ball out of his net two minutes later, but he was.
Patient Rangers build-up resulted in Tavernier threading a superb low pass through to the darting Holt, whose clinical finish into the far corner was worthy of the applause 44,000 fans were giving it.
McKay should have put Warburton's men in front soon after, screwing wide from Miller's chipped cross.
Waghorn - searching for his 15th of the season - curled wide of the top left corner then another Holt drive was deflected wide as Queens tried to take a breath.
James Fowler's Dumfries side could have regained the lead in one rare foray forward, had substitute Liam Coogan's low effort been hit with more strength.
When referee Cook pointed to the spot after a foul on Rangers midfielder Andy Halliday with two minutes left on the clock, few expected Waghorn not to take the opportunity but a flying dive to his right by Thomson saved the penalty.
However, it only delayed the winner for 60 seconds, with substitute Oduwa's cross nodded in at the near post by Waghorn to ensure he was the hero after all.
Lineup, Bookings (5) & Substitutions (6)
Rangers
- 25 Foderingham
- 02 Tavernier
- 04 Kiernan
- 06 Ball
- 05 Wallace
- 23 Holt
- 16 Halliday Booked
- 22 Shiels (Oduwa - 59' )
- 19 McKay (Clark - 76' )
- 33 Waghorn
- 09 Miller (Law - 59' )
Substitutes
- 07 Law
- 10 Oduwa
- 14 Clark
- 20 Aird
- 32 Kelly
- 42 Hardie
- 45 Thompson
Queen of the South
- 01 Thomson Booked
- 14 Jacobs Booked
- 22 Hooper Booked
- 06 Higgins
- 23 Marshall
- 07 Harris (Rutherford - 87' )
- 16 Hutton
- 17 Pickard Booked
- 10 Conroy
- 24 Smith (Coogans - 70' )
- 09 Lyle (Oliver - 65' )
Substitutes
- 12 Rutherford
- 18 Heffernan
- 19 Moxon
- 20 Atkinson
- 21 Hilson
- 28 Oliver
- 33 Coogans