John Baird made himself a Raith Rovers hero as his late goal secured a shock 1-0 extra-time win over Rangers in the Ramsdens Cup final.
The Ibrox men had enough opportunities to win the cup in normal time but saw defenders Bilel Mohsni and Lee Wallace waste clear-cut chances to score.
Rovers goalkeeper Lee Robinson was the hero for his former club Queen of the South in last year's final and came up with another brilliant display, making a string of important saves.
Nicky Law hit a post for the cup favourites in the first half of the additional 30 minutes, but Baird ended Rangers hopes of a trophy treble when he bundled home the winner in the 118th minute after a defensive mistake by Mohsni.
There was a time when to even suggest that Rangers might be appear in the final of competition exclusively reserved for teams from Scotland's lower leagues would see anyone's sanity questioned.
But for the fallen giants, it should have been another milestone match in their attempts to march back to the top of the Scottish game.
Their first appearance in a final since Nikica Jelavic won them the 2011 League Cup with his extra-time winner against Celtic was played out in front of a capacity crowd at Hibernian's Easter Road home, with more than three quarters of the 19,983 crowd backing Ally McCoist's men.
But the League One champions trudged off to a chorus of boos as furious supporters let the manager know what they thought of his team's performance.
There were only smiles and cheers for Raith boss Grant Murray and his team, though, as Rovers celebrated their biggest win since lifting the League Cup back in 1994.
Rangers hopes had been high before kick-off as they were able to name Law, Ian Black and Jon Daly in their line-up.
All three had been injury doubts but started in a side that also included Mohsni, back after a ban.
Murray made just one change to his Raith side ahead of the Easter Road decider as Kevin Moon came in for Fraser Mullen.
Rangers started brightly and Steven Smith volleyed over inside the first minute before skipper Lee McCulloch tugged a free-kick wide soon after.
Dougie Hill's slack header then gave Black a chance to strike from 25 yards but Robinson sprang well to push it over his bar.
The opener should have arrived after 11 minutes. Smith found Mohsni unmarked from a free-kick wide on the right but the Frenchman headed over from just eight yards.
However, after that initial flurry of chances, Rangers struggled for invention in the final third. It took some skill from Fraser Aird on the right to tee up Law on the half hour but his shot was weak.
Robinson had to be alert again to keep out a curling set-piece from Smith just before the break.
The Fifers' goalkeeper was proving to be a vital figure in their resistance and he came up with another crucial stop when Aird found Wallace at the back post. The former Rangers apprentice darted from his line to block, leaving Wallace regretting another big miss.
With the clock ticking past the hour, nerves were beginning to set into the Rangers display. Richard Foster's slip let in Elliot but the Raith striker put his shot wide.
Rangers sent for Nicky Clark after 61 minutes as he replaced Kyle Hutton, but there was more alarm in the Ibrox ranks when the ball dropped over McCulloch's shoulder and onto his hand in the penalty area. Referee Kevin Clancy, though, was unmoved.
Clancy was becoming a busy man, dishing out yellow cards to Clark, substitute Sebastien Faure, Black, Smith, Grant Anderson and Joe Cardle.
Black's quick free-kick played in Clark with six minutes of normal time remaining but Robinson again kept his side in it with a diving parry, while Mohsni blew another great chance in stoppage time as he somehow headed over from two yards.
Aird then had to sprint back 80 yards to prevent Baird scoring a breakaway winner for Rovers as the action grew frantic. But with no breakthrough, the extra-time period was called for.
Law thought he had won it midway though the first 15 minutes when he latched on to Daly's knock-down to smash a volley off Robinson's left-hand post.
It was as close as Rangers had gone but it would be Raith who would be the ones celebrating at the final whistle.
With time running out, Mohsni had the chance to clear from inside his own penalty area but fell over. McCulloch then tried to clear but struck the ball against team-mate Foster.
Rovers substitute Greig Spence jumped on the loose ball before firing off a shot which Cammy Bell did well to save.
The Light Blues stopper could do nothing though as Baird darted in to slam a famous winner under the goalkeeper's body to spark wild celebrations in the Raith end.