Hibernian handed Paul Le Guen his first defeat as Rangers manager thanks to a double from Chris Killen at Easter Road.
The New Zealand striker scored early and late in a fascinating tussle which produced nine bookings and two red cards.
But it was a bitter-sweet finish for Killen - already booked for celebrating his second goal - who was sent off after picking up his second yellow card two minutes from time for a foul on Julien Rodriguez.
Phil Bardsley followed him in injury-time after remarks made to referee John Underhill earned him a second caution.
The home side dominated Rangers for an hour but Filip Sebo headed an equaliser midway through the second half before Killen won it nine minutes from time.
Hibs started at a whirlwind pace and Allan McGregor had to react sharply to deny Ivan Sproule.
Killen was then just inches away from connecting with a Michael Stewart free-kick at the far post.
The Kiwi was not to be denied and opened the scoring after eight minutes when Stewart picked him out with another free-kick and he looped a header over McGregor.
It was one-way traffic for much of the first half. McGregor produced a super stop to keep out another Killen header and Karl Svensson did well to block the follow-up shot from Rob Jones.
The pace of Sproule caused Rangers more than a few headaches and another great run by the Northern Ireland international almost picked out Killen again with the visiting defence stretched.
Hibs had a penalty claim turned away by referee Underhill after Killen looked to have been caught in the area by Rodriguez.
Rangers could not muster a single shot at goal in the first half as Hibs proved dominant.
Shelton Martis had a chance early in the second half but could not get enough on his header and McGregor collected.
Bardsley finally had a half-decent effort on goal with a 30-yard free-kick which whistled a couple of yards wide.
It was a warning Hibs did not heed. David Murphy gave away possession and Chris Burke crossed for Sebo to head an unlikely equaliser.
The goal gave Rangers hope but it was Hibs who took all three points when Killen headed in a great cross from Steven Whittaker with just nine minutes left.
Killen was later dismissed for a bad challenge on Rodriguez which earned a second booking and was later followed by Bardsley.