Sofiane Hanni scored the decisive goal to earn Spartak Moscow a barely believable 4-3 win at home to Rangers in the Europa League, the Russian side equalising three times before completing a stunning comeback.

Both sides scored in their own net in a thrilling first half that saw five goals scored, before Raul Riancho's men roared back with two goals in 66 seconds to snatch the points in Moscow.

Hanni was involved in both goals as Spartak somehow triumphed to leap into second place in Group G, above Rangers, although all four sides – with Villarreal and Rapid Vienna completing the pool – can still qualify with two rounds to play.

Rangers, held 0-0 at home by Spartak two weeks ago, led in the fifth minute when Roman Eremenko turned into his own net, but Lorenzo Melgarejo soon levelled with a close-range header.

Daniel Candeias scored a superb goal to restore Rangers' advantage but Connor Goldson knocked a Nikolai Rasskazov cross into his own net to level again.

Rangers led at the interval thanks to 18-year-old Glenn Middleton's first Europa League goal, but the hosts scored twice in a minute to turn a breathless tie around after the break.

Allan McGregor made a sensational save to keep out Hanni's improvised flick, but Luiz Adriano was perfectly placed to nod in his side's third equaliser.

Hanni then gave Spartak the lead for the first time, his 25-yard strike taking a wicked deflection off Goldson to deceive the unlucky McGregor.

Eremenko almost added a fifth but headed against the crossbar before referee Ivan Bebek booked a second Spartak player for diving, with James Tavernier hitting the post deep in added time as Rangers were unable to mount a late fightback of their own.