Scottish Premiership Play-Off: Hibernian 0 Hamilton Academical 2 (aet, 3-4 pens)
Jason Scotland's 13th-minute opener got Hamilton off to a great start on Sunday as they chased the 2-0 deficit from Wednesday's first leg, but it looked as though they would fall short of forcing extra time.
Hibernian's victory at Hamilton ended a run of 13 matches without a win and they went into the return leg full of expectation as a result, but Terry Butcher's men seemingly struggled to cope with the added pressure.
And Frenchman Anthony Andreu punished the hosts by steering home in the third minute of second-half stoppage time to level the aggregate score, taking the encounter to an added 30 minutes, much to the despair of Butcher.
The contest ultimately went all the way to penalties and Kevin Cuthbert's save from Jason Cummings' spot-kick confirmed Hibs' relegation and Hamilton's promotion.
Former Swansea City man Scotland netted Hamilton's first, firing past the helpless Ben Williams after a clever turn.
Both sides saw their fair share of possession, but the visitors dominated in terms of chances, having 10 shots in regulation time, compared to Hibs' four.
Despite Hamilton having the better of proceedings, Hibs almost equalised just before the break as Cummings forced Cuthbert into a stop with a dangerous header.
But the match slipping away from Hamilton, the visitors desperately pushed for a second goal to level the aggregate score, and they were eventually rewarded for their persistence deep into stoppage time - Andreu knocking in from close range to earn another half an hour.
The two sides could not be separated in extra time, forcing a penalty shoot-out, and after Kevin Thomson and Cummings saw efforts saved for Hibs, Hamilton claimed an historic triumph.
Hibernian join Edinburgh rivals Hearts in being relegated to the Championship.