A last-minute penalty from Mikel Arteta clinched the championship for Rangers after an extraordinary finale to an extraordinary season.
In the end it was all settled by goal difference as Celtic's 4-0 win at Kilmarnock proved to be one strike short of glory.
This was Rangers' 50th title - a world record - and was wrapped up with virtually the last kick of the game.
The lead had been Rangers' earlier in the day and remained there for most of the proceedings, including the moments before Arteta's spot kick.
But there had been a point when Celtic were in the driving seat until a late flurry of goals allowed the Ibrox faithful to begin the party.
Rangers had secured victory against Kilmarnock two weeks ago with an early goal blitz and were keen to repeat the trick.
The bookies had been so convinced that the first goal would be scored by a blue shirt that Dan Eggen, who has never played for Rangers and now never will, had lower odds than any of the Dunfermline team bar Scotland striker Stevie
Crawford.
They were proved right when the first goal duly arrived after just two minutes and 25 seconds, with Michael Mols netting it on the turn with an effort that lacked power but was perfectly placed to go in off Derek Stillie's right-hand
post.
Surely it was now a question of how many - but Jason Dair had other ideas and stunned the home crowd with a fine equaliser in the 11th minute.
It had been a well-worked move too, with Crawford, Lee Bullen and Craig Brewster all involved and Dair's finish from more than 20 yards out gave Stefan Klos no chance in the home goal.
Ibrox fell silent and suddenly a fourth-minute miss by Ronald de Boer, who had sent a diving header wide, became an object of acute regret.
That was until Claudio Caniggia continued his remarkable record of scoring against the Pars this season, netting for the seventh time after Fernando Ricksen's cross from the right had been deflected into the veteran's path.
Rangers' championship bandwagon was back on track thanks to two forwards who are likely to be shown the door at the end of the season.
Mols saw a penalty shout turned down by referee Stuart Dougal and by the time the Dutchman had been denied by the first of two good saves by Stillie news had filtered through that Celtic were leading at Kilmarnock.
That meant Rangers were once again leading only by the number of goals scored but they went ahead on goal difference when Shota Arveladze threw himself across his marker to sent a glancing header past Stillie from Lorenzo Amoruso's pacy delivery from the left.
It had been an excellent finish from a man who has been known to miss easier opportunities but there were no further goals by the break, by which time Celtic had gone 2-0 up at Rugby Park.
That made the chances of a play-off more remote but it could not have been much closer as Rangers were in front only on goals scored once more.
Rangers made a change at the break, with Neil McCann coming on for Caniggia.
De Boer again failed to hit the target from a good position, rolling the ball across goal and wide after Craig Moore had picked him out in a crowded penalty box.
The Ibrox faithful went quiet again when news of Celtic's third at Kilmarnock came in, a goal that put the Hoops ahead on goal difference.
The Pars were furious when referee Dougal awarded an indirect free-kick nine yards in front of goal when Stillie picked the ball up after MacPherson had played it back but off de Boer.
The Fifers packed their defence but Amoruso blasted over.
Klos kept his side in the championship race with a leaping save to deny Brewster and Rangers then made it 4-1 to put them back in the driving seat.
De Boer was the man who netted, timing his run and leap in the box to perfection to meet McCann's free-kick from the left.
Rangers were back on top on goals scored - and two minutes later they were ahead on goal difference when Steven Thompson, who had come on for Mols in the
63rd minute made it 5-1.
Again McCann was the man who made it happen by beating a challenger and crossing to the near post and although Bullen got the initial touch it was only on to the substitute, who poked home from point-blank range.
At last the Rangers fans began to believe the title was now coming their way and Ibrox was a cauldron of noise once again.
Rangers survived a period of pressure from the away side, which saw Moore make a crucial interception in the box to stop Brewster setting up Dair in front of goal.
News that Celtic had missed a penalty was greeted warmly but a fourth at Kilmarnock did arrive soon after to put everything back on a knife-edge.
Thompson then headed against the woodwork with two minutes to go as the home fans prayed they would not be told of a fifth goal at Kilmarnock, which would
hand the title to Celtic.
There was time for a final twist in the tale however when McCann was brought down in the box by Walker and up stepped Arteta to slot home the penalty that won the title.
Teams
Rangers Klos, Ricksen, Moore, Amoruso, Numan, Ferguson,
Arteta, Caniggia (McCann 45), de Boer, Mols (Thompson 62),
Arveladze.
Subs Not Used: McGregor, Malcolm, McLean.
Booked: Ferguson.
Goals: Mols 3, Caniggia 16, Arveladze 30, de Boer 64,
Thompson 67, Arteta 90 pen.
Dunfermline Stillie, Bullen, MacPherson (Walker 70),
Scott Wilson, Grondin (Dempsey 45), Dair, Nicholson, Mason,
McGroarty (McGarty 77), Brewster, Crawford.
Subs Not Used: Ruitenbeek, McNicol.
Booked: MacPherson, Scott Wilson, Bullen.
Goals: Dair 11.
Att: 49,731
Ref: S Dougal (Scotland).