Dundee won an unlikely point at Easter Road with three goals in the last 25 minutes.
Hibs were coasting at 4-1 but allowed Dundee to storm back and Jonay Hernandez secured a draw for them with an injury-time strike.
There was no warning of what was to follow when Garry O'Connor hit two goals for Hibs early in the second half.
But Dundee deserve huge credit for refusing to lie down and they took their reward.
Dundee took the lead after only six minutes. Colin Murdock was caught square when Kelvin Jack thumped forward a clearance and John Sutton raced through to beat Simon Brown with a rising left-foot shot.
It was the signal for Dundee to dominate the early stages as they kept possession well and forced the game towards Simon Brown's goal.
But for all their dominance, they did not seriously threaten Simon Brown and it was Hibs who seized the initiative.
Scott Brown should have done better than loop a tame header into the hands of Jack when he was unmarked 15 yards from goal.
The equaliser arrived midway through the first half when Brent Sancho failed to cut out a throughball and O'Connor pounced.
The striker looked to use his hand to control the ball but referee Charlie Richmond allowed play to continue and O'Connor's shot from the edge of the area was saved low to his left by Jack but Dean Sheils was first to react to the loose ball as he slammed a shot high into the empty net.
Dundee responded and Steve Lovell was guilty of squandering an opening when he dallied on the ball inside the Hibs penalty area when he should have made Simon Brown work.
Hibs took the lead four minutes from the break when Derek Riordan curled a wonderful 20-yard free-kick over the wall and past a bemused Jack.
Within a minute of the second half, Hibs extended their lead when Guillaume Beuzelin picked out an unmarked O'Connor and he had time to control the ball and steady himself before swiping a low shot past Jack.
Sheils then presented O'Connor with his second goal four minutes later when he played in the perfect cross for the striker to nod into the far corner of the net.
Dundee pulled a goal back after 65 minutes when the ball ran away from Murdock in his own area and substitute Garry Brady, who had come on only two minutes earlier, took full advantage to sweep a shot into the top corner of the net.
The goal fired up Dundee and, with Hibs looking uncertain at the back, they still had hopes of pulling off an unlikely result.
Sutton headed narrowly wide from a corner and Hibs never really looked comfortable when they were pinned back.
Then, with just 11 minutes left, substitute Glen Larsen poked the ball home from close range to set up a grandstand finish.
It was left to Hernandez to have the final say when he scored at the back post from a Callum McDonald cross.