Match ends, Raith Rovers 3, Rangers 3.
A stoppage-time goal from Harry Panayiotou denied Rangers victory and meant their Scottish Championship title will have to wait.
The Raith Rovers sub had a penalty saved seconds earlier but redeemed himself by scrambling an equaliser with the last kick of the ball.
Kenny Miller had added to first-half goals from Harry Forrester and Michael O'Halloran to put Rangers on the brink.
But goals from Louis Longridge and James Craigen helped spoil the party.
The draw not only extends Rovers' unbeaten run to seven games but also takes Ray McKinnon's fourth-top side closer to securing a place in the promotion play-offs after Greenock Morton and Queen of the South drew their matches.
Several thousand Rangers fans had packed the stands at Stark's Park in anticipation of a title party.
However, when Longridge's perfectly-struck shot sailed over goalkeeper Wes Foderingham, it was the first hint that the celebratory champagne might remain on ice.
After watching a point-blank shot somehow turned round the post by Kevin Cuthbert, Forrester planted a header in off the post from the resultant corner to renew the visitors' hopes.
Forrester had looked Rangers' greatest threat and he showed great composure to pick out O'Halloran for a tap-in when a less cool customer might have shot himself.
For all their attacking muscle, Mark Warburton's side have a vulnerability in defence and Craigen had far too much room to fire in a long-range shot that may have taken a slight deflection but should not have been allowed to slip into the net by Foderingham.
What looked like the winning blow was struck by Rangers stalwart Miller, who raced on to Andy Halliday's pass to hammer the ball past Cuthbert for his 17th goal of the season.
As much as the goal meant to him and his team-mates, it was nothing compared to the feeling of jubilation among the visiting fans as they prepared for life in the top-flight of Scottish football.
However, although Panayiotou had a spot kick saved by Foderingham after being fouled by Halliday, the on-loan Leicester City forward grabbed a sensational equaliser by forcing the ball over the line at the end of a goalmouth scramble.
Rangers will have another chance to claim the title on Tuesday, though, when they welcome Dumbarton to Ibrox.
Line-ups
Raith Rovers
Formation 4-4-1-1
- 1Cuthbert
- 2Thomson
- 55Barr
- 6Benedictus
- 23McKeown
- 4Callachan
- 5Toshney
- 14DavidsonBooked at 75mins
- 21LongridgeSubstituted forPanayiotouat 61'minutesBooked at 90mins
- 28CraigenSubstituted forAndersonat 74'minutes
- 15ThomasSubstituted forConnollyat 74'minutes
Substitutes
- 7Anderson
- 8McCord
- 11Panayiotou
- 12Matthews
- 18Connolly
- 26Court
- 31Law
Rangers
Formation 4-3-3
- 25Foderingham
- 2Tavernier
- 4Kiernan
- 27Wilson
- 5Wallace
- 15ForresterSubstituted forZelalemat 80'minutes
- 16Halliday
- 23Holt
- 19McKaySubstituted forShielsat 72'minutes
- 9Miller
- 29O'HalloranSubstituted forKingat 61'minutes
Substitutes
- 1Bell
- 6Ball
- 7Law
- 8Zelalem
- 14Clark
- 17King
- 22Shiels
- Referee:
- Euan Anderson
- Attendance:
- 6,943
Match Stats
- Possession
- Home39%
- Away61%
- Shots
- Home12
- Away10
- Shots on Target
- Home6
- Away6
- Corners
- Home5
- Away3
- Fouls
- Home12
- Away12
Live Text
Post update
Full Time
Second Half ends, Raith Rovers 3, Rangers 3.
Booking
Harry Panayiotou (Raith Rovers) is shown the yellow card for excessive celebration.
Goal!
Goal! Raith Rovers 3, Rangers 3. Harry Panayiotou (Raith Rovers) right footed shot from very close range to the centre of the goal.
Post update
Corner, Raith Rovers. Conceded by Wes Foderingham.
Post update
Foul by Andy Halliday (Rangers).
Post update
Harry Panayiotou (Raith Rovers) wins a free kick in the defensive half.
Post update
Foul by Craig Barr (Raith Rovers).
Post update
(Rangers) wins a free kick in the attacking half.
Post update
Corner, Raith Rovers. Conceded by Wes Foderingham.
Post update
Penalty saved! Harry Panayiotou (Raith Rovers) fails to capitalise on this great opportunity, right footed shot saved in the bottom right corner.
Post update
Penalty conceded by Rob Kiernan (Rangers) after a foul in the penalty area.
Post update
Penalty Raith Rovers. Harry Panayiotou draws a foul in the penalty area.
Post update
Foul by Rory McKeown (Raith Rovers).
Post update
Kenny Miller (Rangers) wins a free kick in the attacking half.
Post update
Attempt missed. Billy King (Rangers) left footed shot from outside the box is high and wide to the left.
Post update
Foul by Harry Panayiotou (Raith Rovers).
Post update
Jason Holt (Rangers) wins a free kick in the defensive half.
Post update
Attempt saved. Harry Panayiotou (Raith Rovers) right footed shot from the centre of the box is saved in the bottom right corner.
Post update
Foul by Rob Kiernan (Rangers).