Dunfermline Athletic booked their place in Sunday's draw for the last 16 of the Betfred Cup with a 2-2 draw against Hearts at Tynecastle.
The Pars also came out on top in the shoot-out but Allan Johnston's men had already done enough to secure top spot in Group B. Peterhead won 3-0 at Elgin in the other group game but look set to miss out despite finishing with nine points.
Falkirk had already won Group A and made it four wins out of four with a 3-0 victory at Brechin. Inverness CT beat Forfar 2-1 at Station Park but failed to make it through as one of the four best runners-up.
Dundee and Dundee United are almost certain to progress from Group C and they meet at Dens Park on Sunday, live on BT Sport at 3.00pm. Raith Rovers beat Cowdenbeath 2-0 in today's game at Stark's Park.
Hibernian ran out 3-0 winners away to Alloa Athletic to clinch Group D ahead of Ross County. The Staggies were held to a 0-0 draw at Arbroath but won the shoot-out and qualify in second place with 10 points.
Ayr United scored inside 20 seconds as they thrashed Annan Athletic 6-1 to finish with a 100% record in Group E. Kilmarnock also go through after beating Dumbarton 3-0 at Rugby Park.
Motherwell won Group F on Tuesday but left it late to defeat Berwick Rangers 1-0 at Fir Park to make it four wins from four. Morton saw off Edinburgh City 5-0 at Cappielow to finish second but failed to qualify.
Hamilton Accies topped Group G after a 3-0 home win over Stenhousemuir as Albion Rovers just missed out. Alan Trouten took his Betfred Cup tally to seven goals but it finished 2-2 against Queen of the South at Palmerston, with Queens winning the shoot-out.
Partick Thistle needed a late winner to beat Stranraer 1-0 at Firhill and join Group H winners Livingston in the second round while St Mirren thrashed Airdrieonians 5-0.
The draw takes place after Sunday's Dundee derby, with last-16 ties due to be played on the midweek of August 8/9.