Celtic survived a scare in their William Hill Scottish Cup tie against St Mirren before booking a semi-final place with an emphatic 4-1 win at Parkhead.
Buddies centre-back Harry Davis stunned the Hoops support with his goal from close range in the 13th minute and only the crossbar prevented the Championship's bottom side doubling that lead in the 53rd minute.
The runaway Ladbrokes Premiership leaders had laboured but two goals in quick succession through right-back Mikael Lustig and forward Scott Sinclair ended any prospects of a shock defeat.
In-form striker Moussa Dembele added a third with his 32nd of the season with substitute Leigh Griffiths, on for Nir Bitton, firing in the fourth as Brendan Rodgers' side extended their unbeaten domestic run since the start of the season to 34 games.
Celtic join holders Hibernian, Old Firm rivals Rangers and the winner of the Aberdeen versus Partick game into the semi-final draw.
Before the excitement there was a pre-match minute's silence in tribute to Tommy Gemmell, the 'Lisbon Lions' full-back who died recently at the age of 73 following a long illness.
Jack Ross' side, despite their lowly league position, had won their previous four matches and were unbeaten in five and sensationally found themselves ahead.
Midfielder Stephen Mallan knocked a free-kick wide to Cameron Smith, unsettling the Hoops defence, and his deep cross from the left was headed back across goal by striker John Sutton for Davis, on loan from Crewe, to slide in from five yards out.
The Buddies fans, like most people inside Celtic Park, could barely believe it. It was the first goal Rodgers' side had conceded at home since December and the first in either the Betfred Cup or Scottish Cup this season.
There was no immediate response either, although skipper Scott Brown came close on the half-hour mark with a left-footed drive which went inches past the post.
There was little surprise when winger Patrick Roberts replaced the out-of-sorts Gary Mackay-Steven for the start of the second half.
However, just before Griffiths emerged from the dugout, Saints almost went 2-0 up, Dembele's clearance from Mallan's free-kick rebounding off the crossbar with goalkeeper Craig Gordon beaten, before Davis headed wide.
That proved to be the turning point of the game. Lustig flicked in a Roberts free-kick and order was restored when Sinclair curled the ball past Saints goalkeeper Billy O'Brien from 16 yards.
Celtic relaxed and pressed for more and in the 68th minute Dembele tapped in a Sinclair cross following good work by Roberts for his 12th goal in six games, and the 20-year-old French striker missed the target by inches from close range after being set up again by Sinclair.
Saints kept plugging away - Lewis Morgan curled a shot just wide - but the tie was effectively over.
Eboue Kouassi, the 19-year-old from the Ivory Coast bought in January from Krasnodar for a reported fee of around £3million, replaced Stuart Armstrong to make his debut seconds before Griffiths drilled in number four from 25 yards.
Boyata headed in Griffiths' corner but referee Steven McLean blew for an infringement and the flag was up when Griffiths knocked the ball in after Roberts'drive had rebounded off the post, the match ending with Celtic's hopes of a treble still intact and St Mirren thinking of what might have been.