An extra-time winner from debutant Tony Andreu gave Dundee United a 3-2 victory over Peterhead in the third round of the IRN-BRU Cup.
Charlie Telfer gave United the lead in the opening minute before Rory McAllister, a summer transfer target for the Tangerines, equalised just before the hour mark.
Nick van der Velden put the Championship back in front after 34 minutes before McAllister restored parity with a header only a minute later.
That was how it stayed until the second half of extra time when Norwich City loannee Andreu headed home the winner to spare United’s blushes.
Peterhead made three changes from the side beaten 1-0 by Stranraer last weekend with Simon Ferry, Nathan Blockley and Jordon Brown replaced by Kevin Dzierzawski, Leighton McIntosh and Scott Rumsby.
United gave debuts to Dundee United defenders Frank van der Struijk and William Edjenguele as well as deadline day loan signing Andreu.
The hosts made a stunning start to the match and took the lead after only 59 seconds with Charlie Telfer’s long-range strike flying past Fraser Hobday.
A mix-up in the Dundee United defence between Lewis Toshney and van der Struijk almost gave Peterhead a way back into the match but Stefan McCluskey was unable to take advantage.
The Tangerines had a chance to double their lead after 24 minutes but on-loan Huntly stopper Hobday was equal to Blair Spittal’s deflected drive.
But Peterhead equalised five minutes later with their first shot on target of the afternoon with the clinical McAllister producing a superb finish after some more erratic defending from the home side.
United regained the initiative after 34 minutes when Nick van der Velden was afforded too much room inside the Peterhead penalty area before fizzing a low shot beyond Hobday.
But it took Peterhead only 60 seconds to find another response with Leighton McIntosh gliding past Paul Dixon before crossing for McAllister to head beyond Luis Zwick.
United should have went 3-2 ahead just before the interval when a Willo Flood fell perfectly for teammate Toshney but the defender somehow fired wide from four yards out when a goal looked certain.
Peterhead made an encouraging start to the second period with McCluskey testing Zwick with a powerful attempt from distance.
United thought they had gone back in front when an Edjenguele header from a Toshney cross looked destined for the bottom corner only for Hobday to make a spectacular stop to keep the scores level.
McAllister went painfully close to notching his hat-trick in the 68th minute but was denied by a last-ditch block by Toshney before United substitute Simon Murray crashed the ball off the underside of the crossbar as both sides pushed for the game’s next goal.
The woodwork came to the rescue again for Peterhead in the 76th minute when Spittal picked out Murray with an exquisite chip but the former Arbroath forward’s header was tipped onto the crossbar by Hobday.
The Peterhead goalkeeper made another great save to deny Andreu before United hit the woodwork for the third time when a Spittal cross hit the crossbar and, with neither side able to produce a winner, the game moved into extra time.
United felt they should have had a penalty in the first period of extra time when Dixon looked to have been caught late by Nicky Riley but referee Nick Walsh waved play on.
The winner for the home side came in the 116th minute when Andreu headed home a Spittal cross, which was harsh on Jim McInally’s men.