Top seed Felix Auger-Aliassime crashed out of the Grand Prix Hassan II after he was beaten 6-4 2-6 7-6 (9-7) by world number 65 Alex Molcan.
Making his debut in Marrakech, Auger-Aliassime arrived off the back of an impressive start to 2022.
Indeed, the world number nine had already triumphed in Rotterdam and been runner-up to Andrey Rublev in Marseille.
But he came unstuck at the hands of the player ranked 56 places lower, with Molcan securing his first career win over a top-10 player.
The Slovakian crucially broke in game nine on the way to taking the opening set. Auger-Aliassime, who hit 10 double faults during the contest, responded by dominating the second, while the players exchanged breaks in a decider that went to a tie-break.
The top seed forced match point at 7-6 up, but Molcan held on by reeling off the next three to secure a dramatic victory.
David Goffin, meanwhile, claimed his 300th tour-level win as he came from behind to defeat three-time champion Pablo Andujar.
Andujar had seen off second seed Dan Evans in the first round but, despite making a fast start against Goffin, it was the Belgian who triumphed 5-7 7-6 (7-4) 6-3.
Federico Coria overcame Mirza Basic in straight sets, while Roberto Carballes Baena defeated Portugal's Joao Sousa 6-2 7-6 (7-4) and Richard Gasquet saw off Pavel Kotov.