Winger Gary Mackay-Steven impressed against his old club as Aberdeen eased through to the William Hill Scottish Cup quarter-finals with a 4-2 win over Championship side Dundee United.
Mackay-Steven scored twice and provided the assist for Adam Rooney's opening goal, with Kenny McLean also on the scoresheet.
But it was not always plain sailing for the home side, as some uncharacteristically slack defending saw United counter with efforts from Sam Stanton and Paul McMullan.
The game sparked into life when goalkeeper Harry Lewis fumbled Mackay-Steven's ninth-minute shot but recovered to divert Adam Rooney's follow-up wide with the aid of a deflection off defender Mark Durnan.
The home side took the lead in the 20th minute. McLean's cross from the right was not quite met cleanly by Mackay-Steven but his shot looped over Lewis and seemed destined for the net. In true poacher style, Rooney charged in to make sure, heading home from no more than a yard.
Former United winger Mackay-Steven got his first goal after 27 minutes. Niall McGinn dispossessed the hesitant Craig Slater and with the United defence short-handed he slid in Mackay-Steven who rolled the ball past Lewis from eight yards.
If it was looking like an easy Dons win was on the cards, there was a rude awakening to come seven minutes later as former Hibernian midfielder Stanton found himself through on goal and slotted past goalkeeper Freddie Woodman to reduce the arrears.
The United joy was short-lived as it took less than a minute for Aberdeen to find the net again. Ryan Christie was the provider with a superb arcing cross, and McLean rose to head home from 12 yards.
Mackay-Steven was clearly enjoying himself and he netted the home side's fourth goal after 55 minutes. Christie was again involved in the build-up, bursting through the middle and slipping a neat pass to Mackay-Steven on the right.
He homed in on goal and saw his shot come off the hands of Lewis and fly high into the net.
United clawed their way back to two goals adrift once more with 20 minutes remaining, and again it was a strike that came almost out of nothing.
Substitute McMullan found space on the left edge of the penalty area and curled a superb shot past the helpless Woodman and into the net.
Christie passed up a glorious chance to bag a fifth Aberdeen goal with six minutes remaining, contriving to blaze over the bar after being picked out by Dominic Ball.
And the visitors almost found the net again, as Anthony O'Connor turned Grant Gillespie's cross towards his own goal. Woodman saved well and O'Connor recovered to make an excellent clearance.
Scottish Cup News
St Johnstone complete unlikely Scottish Cup double
St Johnstone beat Hibernian 1-0 in the Scottish Cup final on Saturday to seal a historic domestic cup double having also won the League Cup.
Rangers condemn Celtic to trophyless season after Scottish Cup win
Celtic's four-year Scottish Cup reign came to an end at the hands of Rangers on Sunday.
Acrobatic overhead kick puts Rangers in front vs. Celtic
Scottish Cup: Steven Davis (10') Rangers 1-0 Celtic
Celtic win fourth consecutive Treble in dramatic shootout Scottish Cup final win vs. Hearts
Celtic completed a historic fourth consecutive domestic Treble after overcoming Hearts on penalties in the Scottish Cup final.
Celtic supporter jailed for 10 months after punching three police horses
A Celtic fan has been jailed for 10 months after punching three police horses before a Scottish Cup match.
Celtic clinch 'Triple Treble' with Scottish Cup win
Celtic wrapped up a domestic Treble for an unprecedented third straight season after beating Hearts 2-1 in the Scottish Cup final on Saturday.