Dundee are on the verge of an early season Betfred Cup exit after going down to a shock defeat to Peterhead.
Prolific striker Rory McAllister put the Dark Blues to the sword with two second half goals – one a free-kick and the other a penalty.
A Greg Stewart effort with seconds remaining proved to be a consolation and, with first place in their group now outwith the reach of Paul Hartley’s men, it probably couldn’t even be described as that.
A win against Forfar on Saturday could yet claim second spot in Group A but there is no guarantee that would be enough to progress as one of the four best second-placed sides.
The visitors were first to threaten after seven minutes, Rory Loy firing a loose ball over from 20 yards after a cross was partially cleared into his path.
In the 19th minute a free kick by Stewart 25 yards out to the left of goal was played towards the back post but defender Ryan Strachan cleared for a corner as Julen Etxabeguren waited to pounce.
The Dundee pressure was maintained and three minutes later Craig Wighton attempted to chip keeper Graeme Smith but failed to get enough on the shot and Smith gathered with ease.
For the hosts, a Jamie Stevenson free kick was head-flicked goalwards by Scott Rumsby but straight at Scott Bain.
Dundee continued to threaten and Loy headed powerfully and just beyond the far post from a corner kick.
A threaded cross field pass by Wighton found substitute Paul McGowan – on for the injured Mark O’Hara – who took the ball in his stride but his shot was well blocked by Smith with 36 minutes gone.
As half-time approached Scott Rumsby saved the day with a perfectly timed tackle on Wighton by the penalty spot then moments later Darren O’Dea bulleted a header from a Stewart corner but Smith saved brilliantly with a reflex block.
Dundee started the second half on the front foot and Danny Williams dribbled his way into the area but his shot went into the side-netting.
A neat build up by the home side produced their best chance on the hour, Jordan Brown shooting wildly over from the edge of the box.
Out of the blue a goal arrived after 63 minutes but it was for the Blue Toon despite all the possession from the visitors.
McAllister was tripped 20 yards out and slightly to the left if goal. The striker took the free kick himself and gambled that the Dundee wall would jump, which they did and the ball took a slight deflection off a stray foot as it went into the net.
Michael Duffy came off the bench and whipped a free kick up and over following a rash challenge by fellow sub Samir Nasoor.
McAllister tried his luck with a low shot from distance on the turn but the ball skidded wide as the rain poured down, then Nathan Blockley almost scored a wonder goal from 35 yards as he tried to chip over the stranded Bain.
A minute from time it was all over.
McAllister was sent sprawling by Bain after bearing down on goal and the former Dundee man coolly clipped in the spot kick.
Straight from the restart Dundee went up the other end and Stewart touched in a cross from close range to leave the home nerves jangling for the remaining added minutes but there wasn’t enough time for the Dark Blues to take the contest to a penalty shoot-out.