Moussa Dembele's first Celtic goal gave the Hoops a dramatic last-gasp 2-1 win over Astana and booked them a place in the Champions League playoff.
The third qualifying tie had swung towards Brendan Rodgers' side after the 1-1 draw in Kazakhstan and striker Leigh Griffiths, who levelled in the Astana Arena, scored from the spot on the stroke of half-time before substitute Agim Ibraimi levelled with an opportunist long-range effort.
However, in stoppage time, French forward Dembele, on for James Forrest, slammed in a penalty after he had been tripped by Igor Shitov, who was sent packing by Romanian referee Istvan Kovacs for a second booking, with Dmitri Shomko following him amid the mayhem.
It was a crazy end to the match but the Scottish champions go into Friday's playoff draw looking for a favourable tie which will see them into the competition proper for the first time in three seasons.
Rodgers had some selection dilemmas and although there was little surprise that much-criticised Efe Ambrose was dropped from central defence, the Nigeria international was not even on the bench.
Right-back Saidy Janko came into the team with Mikael Lustig moving inside to partner 20-year-old Irishman Eoghan O'Connell.
Defender Kolo Toure started on the bench and the 35-year-old's fellow new signing Dembele was also dropped from attack for James Forrest with Griffiths leading the line.
The visitors were soon on the back foot. However, the minutes ebbed with visiting keeper Nenad Eric seeing little action although a 20-yard snap-shot from Griffiths midway through the first-half cleared the far post but not by much.
Celtic suffered a blow on the half-hour mark when winger Patrick Roberts went off after picking up an injury to be replaced by midfielder Stefan Johansen with Forrest moving to the right and Armstrong switching to the left.
Three minutes from the break the former Dundee United midfielder found a yard of space in the Astana box but his drive from 12 yards was smothered by Eric, before defender Yuri Logvinenko blocked a goal-bound Griffiths effort.
However, with the last kick of the first-half amid some drama, the home side got the breakthrough.
When defender Abzal Beysebekov clumsily fouled Tierney inside the box as they challenged for a bouncing ball, Romanian referee Kovacs pointed to the spot.
After a delay, Griffiths took great delight in smashing the spot-kick past Eric, who dived the wrong way.
The goal lifted the home crowd and they went for number two from the restart.
Only a perfectly timed tackle from Shitov foiled the hosts but slowly the Kazakh club began throwing players forward in search of an equaliser.
Roger Canas had the ball in the net in the 56th minute but the assistant's flag was up to the relief of the Hoops fans but there was despair around the corner.
On the hour mark Toure replaced Armstrong to make his debut but moments later it was all square.
Gordon raced outside his box to head clear a through ball and although it went a decent distance, Ibraimi, on for Azat Nurgaliyev controlled the ball and quickly sent it soaring into the empty net.
The game stretched further. Dembele replaced Forrest after Junior Kabananga had flashed a shot wide of Gordon's right-hand post.
Shitov, booked in the first half, was lucky to escape punishment after a foul on Griffiths but he got his just reward for a trip on Dembele who became the Parkhead hero by despatching the crucial penalty.