Losing two nil from Wednesday's first leg, Hamilton fought back to a 2-2 aggregate score when Tony Andreu blasted home in stoppage-time going on to win the tie on penalties.
The Championship side had Hibs pinned back in their defensive third for large periods of the game and their nerve proved stronger than the hosts when it went to spot-kicks.
There was never any doubt that Hamilton player-manager Alex Neil would make sure a real fist was made after defeat in the first leg at New Douglas Park, but they looked destined to stay in the Championship until Andreu struck right at the death.
Neil had asked his players to play like Liverpool in the Champions League final when they came from 3-0 down at the interval - and that rallying call seems to have been heard.
The dramatic win sees Hibs join Hearts in the Scottish Championship after both Edinburgh sides were relegated. Hibs have been in the top flight since 1999 and will also face a Rangers side who were promoted. With three of the four biggest sides outside the top flight, Scottish football will have a lop sided look next season. It will not help Celtic either, with three of the biggest fixtures now missing.
Not that the likes of Aberdeen, Motherwell or Kilmarnock will be moaning - they have a golden opportunity to taste European football by finishing in the top two behind Celtic.