League Cup Groups A & B: Peterhead stun Hearts, Falkirk go through as winners
Rory McAllister converted a late penalty as Peterhead stunned Hearts with a 2-1 victory in the League Cup.
Jason Brown headed the League Two outfit into an early lead, with Kyle Lafferty levelling with his fourth goal in three games.
Paul Willis scored late on as East Fife edged out Elgin City 3-2.
Falkirk wrapped up Group A with a 4-0 win over Forfar, Myles Hippolyte scoring a hat-trick, while Stirling Albion beat Brechin City 2-0.
The Bairns made it three wins from three to guarantee seeded status in the knockout phase and Inverness CT need to win at Forfar on Saturday to leapfrog the Binos and hope to claim one of the four best runners-up spots.
Group B is still wide open after Hearts' shock defeat at Balmoor.
The Blue Toon started brightly and Willie Gibson had curled a free-kick narrowly wide and Jordan McGhee made a goal-line clearance from Russell McLean before they took a sixth-minute lead.
Hearts were caught napping at a corner and Gibson's delivery from the right was met powerfully by the head of Brown.
The visitors were level on 17 minutes, Lafferty firing a Michael Smith cross home from close range shortly after Isma Goncalves had sent an effort just wide.
Jack Hamilton fumbled a McAllister free-kick just before the half hour, with Krystian Nowiak doing well to clear.
Hearts then began to enjoy more territory against the part-time hosts and Greg Fleming did well to stop a raking strike from Jamie Walker before Goncalves curled a shot over the top.
Ian Cathro's side were punished for not taking those chances when Arnaud Djoum bundled Jordon Brown over in the final minute after a great run from McAllister and the striker kept a cool head to send Hamilton the wrong way from the spot.
Hearts and Peterhead are level on six points going into the final fixtures on Saturday.
Dunfermline, who sit top of the section on eight points, go to Tynecastle, with Peterhead away to Elgin.
East Fife earned their first win of the tournament in a see-saw match in Methil. Willis tapped in the decisive goal after a Nathan Flanagan shot was parried into his path.
Thomas Reilly netted twice for Elgin, with Chris Duggan levelling for the hosts and Mark Docherty on target from the penalty spot.
Hippolyte's first goal at the Falkirk Stadium was stunning strike from 25 yards after just eight minutes.
Nathan Austin then added a header before Hippolyte thumped in another powerful strike.
The 22-year-old forward completed his hat-trick five minutes into the second half, drilling home from the back post area.
Stirling Albion sit second in Group A, having completed their four matches with a second victory.
Peter MacDonald converted a penalty on 40 minutes and Liam Caddis did the same right at the end.