Spartans marked their debut as a Scottish Professional Football League club with a shock win over a Dundee United side relegated from the top flight last season.
Premiership sides St Mirren and St Johnstone also suffered surprise losses as the season got under way with the group stage of the Viaplay Cup.
League 2 side Stenhousemuir beat St Johnstone 1-0 while a single goal was enough for Montrose against St Mirren.
Blair Henderson got Spartans’ winner.
The striker’s close-range finish after 11 minutes secured the points for the side promoted to League 2 after winning the Lowland League and coming through the play-offs.
Goalkeeper Blair Carswell was also a hero for the Edinburgh side, saving Tony Watt’s second-half penalty following Cammy Russell’s foul on Scott McMann.
It is twice in six months that United manager Jim Goodwin has suffered a loss to lower league opposition, having been sacked by Aberdeen after a Scottish Cup loss to sixth-tier Darvel.
Group A
Euan O’Reilly’s shot from outside of the box just after the break was enough to give Stenhousemuir victory over St Johnstone, who lifted the trophy 2020-21.
In the same section, Ayr confirmed the loss of last season’s top scorer, Dipo Akinyemi, sold to York City on Saturday morning.
Matters got worse for the visitors when Ross McGeachie fired League 2 champions Stirling Albion ahead after 21 minutes.
However, Fraser Bryden equalised with six minutes remaining and the Championship side secured a bonus point by winning the penalty shootout 4-3.
Group B
Partick Thistle were another Championship side to take a bonus point.
An amazing 18 successful spot-kicks were taken before the visitors prevailed away to League 2 side Peterhead in the same group as Spartans secured that historic win over Dundee United.
Harry Milne had headed Thistle into a third-minute lead, with Hamish Ritchie firing the equaliser after 32 minutes.
Group C
There were no problems for Premiership side Livingston away to Highland League champions Brechin City.
Joel Nouble fired the opener and Sean Kelly added the second from a free-kick either side of the break before Cristian Montano headed a late third.
Hamilton Academical eased to victory in their derby with tenants Clyde, who were officially the home team.
Liam Scullion thumped the League 2 side ahead after 16 minutes, but Accies’ pressure told through Andy Winter’s six-yard finish after the hour mark.
As Clyde, who were only able to name three substitutes, began to tire, Joe McGlynn’s close-range finish and Scott Martin’s stoppage-time curler gave the League 1 side a deserved win.
Group D
Simon Murray was Ross County’s hat-trick hero as the Premiership side overwhelmed hosts Stranraer.
Craig Ross’ own goal from Tam Orr’s free-kick set the ball rolling, with Jack Baldwin adding the other and Scott Robertson heading the League 2 side’s consolation.
Tiwi Daramola scored for Kelty Hearts in first-half stoppage time, but three second-half goals gave Championship visitors Greenock Morton the points.
Goals from Steven Boyd, Robbie Crawford and Kirk Broadfoot floored the League 1 side.
Group E
Two right-foot shots Aaron Doran had all but secured a victory for Championship hosts Inverness Caledonian Thistle before Keiran McGachie’s late reply for League 2 visitors Bonnyrigg Rose Athletic.
Strikes from Nikolay Todorov and Lewis McGregor in the final four minutes gave second-tier newcomers Airdrieonians victory over League 2 visitors Dumbarton.
Group F
Premiership side Kilmarnock eased to victory against League 1 visitors Annan Athletic despite defender Jack Sanders’ red card for a professional foul after 73 minutes.
By then, Daniel Armstrong had converted a penalty to be followed by strikes from Fraser Murray and Innes Cameron.
Meanwhile, the later televised Fife derby finished 1-1, with Dunfermline Athletic winning the bonus point 4-2 on penalties against hosts Raith Rovers.
Lewis McCann’s curled finish put the League 1 champions ahead, but Dylan Easton’s sublime chipped finish levelled for Rovers before half-time in the first of at least five meetings this season.
Group G
Top-flight Motherwell eased to victory after 16-year-old midfielder Lennon Miller fired them ahead after 25 minutes against League 2 hosts Elgin City, with Jonathan Obika scoring the second with 14 minutes remaining.
League 2 side East Fife took the bonus point after a goalless draw against Championship visitors Queen’s Park.
Group H
Rory McAllister was the hero for League 1 side Montrose as the veteran striker found the top corner after 58 minutes against St Mirren.
Kieran Inglis’ goal after 20 minutes was enough to give League 2 hosts Forfar Athletic the points against Lowland League side Cowdenbeath.