Joe McCabe’s late winner put Buckie Thistle in the last eight of the Highland League Cup after a 2-1 win over Deveronvale.
Substitute McCabe struck through a crowded penalty area in the final minute of the game to earn a home tie against Fraserburgh on December 7.
Scott Dunn had earlier put Deveronvale in front but Scott Ross equalised before half-time.
Vale went in front after 13 minutes after a long ball caught out the Buckie defence, allowing Dunn to gallop clear and finish under goalkeeper Daniel Bell. Only a superb stop from Bell prevented Robert Scott doubling the lead moments later.
Buckie thought they had levelled on 25 minutes when Shaun Wood’s cut-back was met by Scott Adams but amid a crowd of bodies, his shot was deflected into the grateful arms of Grant Pennet.
A one-two between Dunn and Scott set the rangy striker away through on goal but with the angle widening, the goalscorer fired over the top. Buckie’s response saw Ross’ shot cleared into the path of Craig Cowie, who dragged wide.
The home side did level after the half-hour when Ross’ shot squirmed under Pennet and rolled in.
Buckie had the first opportunity of the second period 10 minutes in when Andrew MacAskill’s left-wing free-kick was headed high over the top by Shaun Wood.
The two goalscorers were involved in the game’s next big incident on the hour mark, when Ross turned a Buckie corner goalwards but Dunn was on hand to clear off the line.
The visitors were now struggling to contain Buckie and could have been behind when Ross Aitken’s error allowed Sam Urquhart to run clear.
However, the former Nairn and Elgin City man dragged his shot wide.
As extra-time beckoned, McCabe latched on to MacAskill’s half-cleared free-kick and found Pennet’s bottom corner to send Buckie through.