Dunfermline shocked Dundee with this stunning victory in the second round of the League Cup at East End Park.
The Premiership Dark Blues went into the game as firm favourites against the League One Pars.
However, Dunfermline once again produced the attacking flair they have shown already this season and it will be their name in the hat for the next round of the cup.
Pars boss Allan Johnston made just one change from the team that was defeated up in Peterhead at the weekend with birthday boy Josh Falkingham coming in for Shaun Byrne.
Johnston’s opposite number Paul Hartley kept faith with the same starting XI that lost against Aberdeen at Pittodrie on Saturday opting once again to select three centre-halves in the shape of James McPake, Julen Etxabeguren and Thomas Konrad.
The Pars made a blistering start and had a superb chance to open the scoring with just 30 seconds on the clock when Michael Moffat threaded a pass to Joe Cardle but the winger shot wide with the goal at his mercy.
Dundee then had two chances in quick succession with headers by Julen Etxabeguren, the first saved by the diving home keeper Sean Murdoch and the second flying narrowly past the post.
Cardle then tried his luck from the edge of the Dark Blues’ box with his stinging drive having to be beaten away by Bain.
However, the keeper was helpless to prevent the Pars opening the scoring when Lewis Martin played a cross in from the right towards Faissal El Bahktaoui who cracked a low shot past Bain from 12 yards for his 10th goal of the season.
Dunfermline tails were up and they had a strong appeal for a penalty in the 22nd minute when Micahel Paton fell to the turf in the Dundee box under a clumsy challenge by Kevin Holt but referee Stephen Finnie was not convinced of the case for a spot-kick.
The Dark Blues were struggling to fashion clear-cut chances and their frustration was probably best summed up when McPake tried a shot from all of 35 yards on the half-hour mark that flew tamely wide.
As the half edged to a conclusion, Dundee did start to come more into the game, enjoying the majority of possession and in the 43rd minute, McPake burst into Pars box and hit an audacious chip which clipped the top of Murdoch’s bar.
Dundee started the second half playing towards the travelling support and their fans did not have long to wait for the equaliser in the 48th minute.
A cross from the left was headed back across the box by Paul McGinn. Ross cleverly dummied with the ball going through to the unmarked Kane Hemmings who kept his cool to fire past Murdoch.
Hartley was then forced to make the first substitution of the night when Etxabeguren had to leave the field injured to be replaced by Dylan Carreiro.
Dundee created another great opportunity when Stewart played a pass to Paul McGowan just inside the Pars’ penalty area but Murdoch pulled off a fine save to tip the midfielder’s shot over the bar.
Dunfermline boss Johnston was then sent to the stand for voicing his displeasure over decisions by the officials as tempers threatened to boil over on and off the field.
In the 74th minute, Dundee’s Stewart embarked on one of his trademark runs, cutting in from the right before hitting a fierce left-foot shot from the edge of the Pars penalty area but it flew just inches wide.
Hemmings then had another chance to score again in the 80th minute when he was first to a long ball from the back but his lifted effort sailed past Murdoch’s left-hand post.
It was all Dundee as the clock ticked down but they were hit by a sucker punch in the 86th minute when Paton played a ball to Cardle who managed to squeeze off a shot which squirmed past Bain and into the net.
Then deep in stoppage time, with Dundee pressing for an equaliser, Bain was exposed once again with El Bahktaoui striking his second to send the Pars fans home deliriously happy.
Dunfermline Murdoch, Martin, Talbot, Fordyce, Richards-Everton, Geggan, Paton, Falkingham, Moffat (Wallace, 74), El Bahktaoui, Cardle.
Subs not used Hutton, Thomas, Byrne, Hopkirk, Crossan, Potter.
Dundee Bain, Holt, Konrad, McPake, Stewart, Hemmings, Etxabeguren (Carreiro, 60), Ross, McGowan, McGinn, Harkins.
Subs not used Mitchell, Irvine, Meggatt, Gadzhalov, Black, Curran.
Referee Stephen Finnie.