Stephen Glass celebrated a penalty shoot-out victory in his first game as Aberdeen manager after his side twice came from behind against Livingston.
Goals from Niall McGinn and substitute Florian Kamberi cancelled out a Jay Emmanuel-Thomas double in a 2-2 Scottish Cup draw at Pittodrie.
The Dons lost goalkeeper Joe Lewis to injury just before the first-half opener, but they emerged 5-3 winners in the shoot-out after Jason Holt hit the bar for the visitors.
Former Dons midfielder Glass will now welcome Dundee United to Pittodrie in the quarter-finals next weekend.
His predecessor, Derek McInnes, was at Pittodrie as a TV pundit and there was a departure from the three-man central defence he deployed for most of this season.
The 4-2-3-1 formation, however, was a familiar one throughout McInnes’s eight-year reign and also a continuation of the tactics used during Paul Sheerin’s caretaker spell while former Atlanta United 2 head coach Glass was in quarantine.
There was a warning for the Dons when Nicky Devlin fired just over, but Aberdeen also had early chances and Fraser Hornby saw a shot saved by Max Stryjek after Matty Kennedy’s low cross from the left.
Skipper Lewis tried to play on after an accidental collision with Livingston centre-back Jon Guthrie but admitted defeat after going down again clutching his ribs.
Former Hamilton goalkeeper Gary Woods came on in the 36th minute and his first touch was picking the ball out of the net within 60 seconds.
The move started when Emmanuel-Thomas stole the ball on the right flank after Jonny Hayes ducked in a bid to let it go out for a throw. The powerful forward cut inside, played a one-two with Scott Pittman and gave Woods no chance with an accomplished finish from 12 yards.
Lewis Ferguson saw a free header saved by Stryjek following a set-piece early in the second half, but Livingston proceeded to keep their hosts at arm’s length.
Centre-forward Alan Forrest was proving a nuisance to the Aberdeen centre-backs and he had a shot saved before another one was blocked after Devlin got to the byline with several team-mates supporting.
Aberdeen broke straight up the pitch and equalised in the 77th minute. Hayes found McGinn with a cross and the Northern Ireland international stroked the ball into the top corner from 16 yards.
The hosts looked rejuvenated, but Dean Campbell conceded a needless penalty early in extra-time when his swipe caught Emmanuel-Thomas. The forward picked himself up and stuck the spot-kick into the top corner in the 93rd minutes.
Kamberi was denied by Stryjek before levelling two minutes later when he slid in to stab home McGinn’s pass on the six-yard line, having continued his run after laying the ball off earlier in the move.
Emmanuel-Thomas was inches from a hat-trick after a powerful run and Aberdeen had the better of the second period without seriously troubling Stryjek.
However, they fired five penalties past the goalkeeper in the shoot-out, with Ross McCrorie providing the final blow.