Two goals in a minute gave Spartak Moscow a thrilling win that ended Rangers’ 11-game unbeaten run in the Europa League this season.
Rangers had taken the lead three times in the first half through Roman Eremenko’s own goal and fine strikes by Daniel Candeias and Glenn Middleton.
But they were pegged back by Lorenzo Melgarejo, a Connor Goldson own goal and, after the break, by Luis Adriano.
And Sofiane Hanni’s drive deflected off Goldson to give the home side victory.
Steven Gerrard’s side were left to rue an offside flag that denied Rangers a 4-2 lead, with TV replays suggesting Alfredo Morelos was onside, and a last-minute James Tavernier effort off a post.
It means that the Russians, who drew 0-0 at Ibrox last month but whose poor domestic form has continued under caretaker boss Raul Riancho, leapfrog Rangers into second place in Group G thanks to a better head-to-head record.
Villarreal, who drew 0-0 at Rapid Vienna, now lead the section by a point – but only two points separate all four sides with two fixtures remaining.
Sides meet in Moscow bearing gifts
Rangers’ terrific away form in Europe has been built on a solid defence – just three goals conceded in the five games on the road before Thursday.
However, the art of defending appeared to have been abandoned by both teams as they crossed the white line.
Spartak had limited Rangers to very few opportunities in the goalless draw at Ibrox but gave an early indication they would be more generous as Eremenko turned Middleton’s corner into his own net.
Riancho had made it clear pre-match that only a win would do for his side and they quickly began to show their offensive abilities far exceeded their defensive ones.
Indeed, their centre-back and captain, Salvatore Bocchetti, twice went close before Melgarejo drew the home side level with a diving header from a mesmerising Ivelin Popov cross.
Spartak’s defensive frailties were again laid bare as Jon Flanagan sent a ball through the middle and Candeias, with no defenders in sight, pirouetted before slotting past goalkeeper Aleksandr Maksimenko.
Again, though, Rangers could not hold the lead. Flanagan let Nikolai Rasskazov run off him to latch on to Popov’s slide-rule pass and, when the cross came in, Goldson sliced it wildly with his right foot past the bemused Allan McGregor.
Spartak had not finished supplying their own gifts and Morelos was able to squeeze the ball through to Middleton to hammer past the goalkeeper for a half-time lead that could have been more emphatic had the Colombian not had a strike ruled out for offside.
McGregor was immense once more for Rangers – and he had to be given what was going on in front of him.
He saved well from Hanni twice but could do nothing after the rebound from the midfielder’s second effort was headed in by Adriano.
Worse quickly followed as Hanni picked up possession from the restart and fired in a shot that took a wicked deflection off Goldson and looped over McGregor.
Rangers did not trouble the shaky Spartak rearguard until the final seconds when Tavernier hit a post, but the Russians could have been further ahead by that point as Bocchetti hit the bar with a header and forced another great save from McGregor on the rebound, while Goldson appeared to have capped a nightmare performance by conceding a penalty that was not given.
Rotation turns group table on head – analysis
This was a sore one for Gerrard to take. The Glasgow side’s manager will surely be furious at taking nothing from a match they led on three occasions.
This is a blow to Rangers’ hopes of qualifying but far from the death knell.
Both of their remaining matches – at home to Villarreal and away at Rapid Vienna – are winnable, but only if Rangers can vastly improve defensively.
Gerrard again tinkered with his central defence for this match – replacing Joe Worrall with Nikola Katic. Although the Croat had formed a solid-looking partnership at the start of the season, he and Goldson looked vulnerable all evening.
Few successful sides are built upon a rotation policy in such an important area of the field.
This was one that got away for Rangers and it is a harsh lesson that must be learned quickly.