James Forrest's 114th-minute strike edged Celtic past Dunfermline after the Fifers threatened to end the champions' stranglehold on domestic silverware.
With a penalty shoot-out looming, the substitute worked space to steer a deflected effort into the far corner from 14 yards and send Celtic into the Betfred Cup quarter-finals with a 2-1 home win over the Ladbrokes Championship side.
Neil Lennon's side were looking for a lift following their European disappointment but they again started slowly and needed a wonder strike from Mikey Johnston to open the scoring 10 minutes into the second half.
But Celtic suffered a double blow when Kristoffer Ajer went off injured before Tom Beadling levelled in the 77th minute.
Dunfermline clung on during a one-sided extra-time but Forrest netted his fourth goal in as many games to make it 28 consecutive domestic cup wins for his team and keep alive the prospect of a fourth treble in a row.
The discontent among the Celtic support following their Champions League exit was evident in the much smaller and muted crowd and also a banner in the safe-standing section which accused the board of "downsizing" and "gambling 10 in a row".
Neil Lennon made five changes following Tuesday's defeat by Cluj. Nir Bitton, Boli Bolingoli, Christopher Jullien, Leigh Griffiths and Craig Gordon came in with Scott Brown absent and both Jozo Simunovic and Scott Bain injured.
Dunfermline had a glorious chance 11 minutes in after Jullien misjudged a long ball, but Kevin Nisbet shot wide with only Gordon to beat.
Jullien's difficult afternoon continued. The £7million defender gave away possession, launched into a rash tackle and then got away with a high challenge on Nisbet in the box which left the striker needing treatment on a head injury.
It took almost half an hour for Celtic to seriously trouble Ryan Scully. The goalkeeper pushed away Johnston's strike after positive play from the wide man, then made decent stops from Callum McGregor and Bitton, both from long range.
Jullien then missed Celtic's best chance of the half when he headed Bitton's cross over the bar from four yards.
The hosts started the second half slowly but Johnston lit up proceedings when he collected the ball 25 yards out on the left channel, looked up and curled a looping effort over Scully's dive into the far top corner.
Christie could not take two opportunities to double the lead and Dunfermline struck back soon after Ajer went off wearing a makeshift sling.
Substitute Andy Ryan got round the outside on the left and cut back for Beadling to slot into the corner from 12 yards.
Celtic had two headed chances to avoid extra-time but Bitton hit the top of the post before Jullien headed wide from close range.
The first period of extra-time resembled an attack v defence training session but the Fifers held firm. Scully made an impressive stop from substitute Olivier Ntcham's long-range hit and Forrest headed over as the first period ended.
The one-way traffic continued and Lennon's frustration was evident after Ntcham struck his latest ambitious strike over the bar.
But Forrest popped up with another crucial goal after collecting a pass from Hatem Abd Elhamed following a half-cleared corner.