Sam Cosgrove scored two of Aberdeen's four second-half goals as they beat Championship side Queen of the South to reach the Scottish Cup quarter-finals.
Niall McGinn's interval introduction was pivotal; the winger scored within 90 seconds, then crossed for Andrew Considine and Cosgrove to head in.
Cosgrove's penalty - his 16th goal of the season - made it 4-1.
At 1-0, veteran Stephen Dobbie had scudded Queens level with a stunning 38th goal of the season.
But Derek McInnes' Premiership side recovered from that and have now reached a domestic cup quarter-final for the ninth time in 12 attempts.
Considine had scored twice in the 4-3 defeat by Queens in the 2008 semi-final and, for long periods, another cup shock at the hands of the Dumfries side was a very real prospect.
However Considine, who scored the winner in a 2012 fifth-round replay as Aberdeen edged past Queens, was on target again, bulleted in a header to ease Aberdeen's nerves after Dobbie's leveller.
The longer the second half went on, the more dominant Aberdeen became, and Cosgrove made the game safe when he rolled home a penalty after Andy Stirling was penalised for handball.
McGinn turns the game - analysis
BBC Scotland's Tyrone Smith at Pittodrie
The term "super sub" is used from time to time, and McGinn was just that. Introduced at the break, he completely turned the game Aberdeen's way. And make no mistake, this was a game that looked like it could get a bit sticky for the the Premiership side before he entered the fray.
Scoring a goal, and setting up another two, this was like the McGinn of old, and McInnes will be hoping that can be a catalyst for the Northern Ireland international to really kick on this season.
Special mention must go to Queen of the South striker Dobbie. His stunning strike - goal number 38 of the season - was special, very special.
Aberdeen manager Derek McInnes: "Niall's had a huge impact on the game. I did think about starting him to stretch them.
"It wasn't perfect, but it would be wrong not to acknowledge Stephen Dobbie's strike. People may have thought we would wipe the floor with them but it's never like that."
Queen of the South manager Gary Naysmith: "I think 4-1 is probably a bit harsh. Derek [McInnes] has made a good substitution at half-time and brought on McGinn. He's probably been man of the match.
"We've got to take the positives. For 60 minutes there was nothing between the teams. We scored a fantastic goal. The players kept going, they were credit to the club today. We didn't sit back."