Ruaridh Donaldson's bizarre own goal killed off Stenhousemuir's comeback hopes as Aberdeen progressed to the fifth round of the William Hill Scottish Cup with a 4-1 win at Ochilview.
Andy Munro's header gave the home side hope as they made a storming start to the second half after goals from Niall McGinn, Sam Cosgrove and Greg Stewart – his first since returning to the Dons – had put the visitors in command during a dominant first half.
Aberdeen endured one of the worst results in their history at Ochilview in 1995 when Roy Aitken's team suffered a 2-0 defeat in this competition, and the visiting support began to get edgy.
But Donaldson headed into his own net under no pressure whatsoever midway through the second period and Aberdeen comfortably saw out the remainder of the tie.
Mark McGuigan's second-half equaliser had earned the Ladbrokes League One bottom club a replay in front of a sell-out crowd and Colin McMenamin's team kept their first clean sheet in three months in beating Airdrie at the weekend.
But the Dons took control of this game early on and McGinn had already missed a good chance on the rebound before stroking the ball home in the 13th minute after good skill from Scott Wright.
Stewart saw a shot deflected wide from a good chance before being brought down by goalkeeper Graeme Smith after getting a break from a long ball. Cosgrove netted his 10th goal in 10 matches from the 30th-minute spot-kick.
Stewart dinked the ball home in the 38th minute after being set up by Graeme Shinnie and the Dons looked to be cruising.
Several members of the 1995 Stenny team along with manager Terry Christie, sporting a trademark duffel coat, were paraded at half-time and their successors came out fighting after the restart.
Alan Cook volleyed wide from a good opening and the underdogs broke well after Stewart had a shot blocked in the goalmouth. Joe Lewis pulled off a good stop from Mark Ferry's long-range strike but he was beaten seconds later as Munro headed home Sean Dickson's 53rd-minute corner.
The chances had dried up for the Dons but Donaldson undid his side's second-half work in a moment of madness in the 67th minute. The left-back had space and time to deal with Stewart's over-hit cross but he seemed caught in two minds and crashed a header in off the bar.
The mood around the stadium was transformed as the away support rediscovered their voice and they would have had more to celebrate but for Smith, who pulled off a brilliant double stop from Cosgrove before denying Wright.