Two goals from by Salaheddine Bassir, either side of one by Abdeljilil Hadda at the start of the second half, sealed Scotland's fate. Their despair was compounded by the dismissal of Craig Burley shortly after Morocco had doubled their lead.
The panache of the Moroccan finishing deserved better than the news that Norway, with their long-ball game, had stolen into the last 16 ahead of them by beating Brazil. For Scotland whose technical limitations were exposed despite a greater share of possession, it is time to go homeward to think again.
Scotland, deceptively, were quicker to establish a rhythm. The newly peroxided Burley started in the central role as a highly visible breaking player from midfield.
It was soon apparent why Craig Brown had nominated the free-floating Moustafa Hadji as the danger man. Inside the first 10 minutes he nudged the ball beyond Colin Hendry only for Tom Boyd to head him off at the pass. Scotland did not man-mark Hadji, and on his next surge along the right it was Gordon Durie who tracked him.
In contrast, the best hope of Morocco contributing a self-inflicted wound to Scotland's cause appeared to lie in the eccentricity of the goalkeeper Driss Benzekri. In the 15th minute he betrayed his poor judgement on crosses by dashing 12 yards from his line in a forlorn attempt to field a John Collins free-kick. Durie's head beat him to the punch and he was fortunate to see the ball drift wide.
Seven minutes later came the blow which put Scotland a goal behind for the third match running. Like the near-post header with which Brazil caught them cold, it had a peculiarly British feel. Tahare El Khalej, just inside his own half, launched a long pass which dipped over Hendry's left shoulder inside the penalty area.
Bassir had timed his run behind the Scottish captain to perfection but still had the hard part to do. From the angle of the six-yard box, he buried a vicious left-footed volley between Jim Leighton and his near post. The sheer speed of the ball defeated the keeper's dive.
Scotland's retaliation was swift and spirited. Durie powered a 30-yard drive barely a foot wide, while the overlapping Burley angled a low effort that gave Benzekri a chance to prove his worth as a shot-stopper.
But the counter-attacking capabilities of which Brown had warned nearly earned Morocco a 2-0 lead on the stroke of half-time. Bassir something of a one-man swarm, found himself faced only by Leighton before Hendry slid in to save the day in characteristic fashion.
The Scots were playing towards the end where the majority of their fans were massed in the second half and promptly resumed their pressure. Yet when the next goal arrived, 90 seconds after the restart, it stemmed from another classic breakout by Morocco. Hadji, almost inevitably, was the prime mover behind it.
Picking up a clearance in his own half, the Spanish-based player chipped the deftest of passes over David Weir for Hadda to pursue. Hadda, having left the defender trailing, set about lobbing Leighton. The veteran put his fingers to the ball, which arced teasingly into the air before bouncing like an off-break into the net.
Worse was to follow for Scotland. With some 36 minutes still to play, Burley scythed down Bassir in what was a textbook example of the outlawed tackle from behind. The referee rightly reached for his red card, leaving Scotland to reflect ruefully on the notion that blondes have more fun.
Brown's response was to replace one wing-back, Jackie McNamara, with another in Tosh McKinlay, presumably in the hope that the substitute's more precise delivery from the flanks might trick Benzekri to flap at another ball in the air.
The sight of Hendry loping into the keeper's territory confirmed the strategy, if such a desperate measure could be so described. Ironically, when his distinctive mane met a cross by Christian Dailly in Scotland's next attack, Benzekri gathered cleanly for almost the first time.
Five minutes from the end, Bassir cleverly rounded Boyd before firing the third, the ball going in off Hendry's thigh. Moroccan glee was as unconfined as it was short-lived; Scotland's cup of woe was full to overflowing.
Norway stun Brazil, page 30
SCOTLAND (3-5-2): Leighton (Aberdeen); Weir (Heart of Midlothian), Hendry (Blackburn Rovers), Boyd; McNamara, Burley, Lambert (all Celtic), Collins (Monaco), Dailly (Derby County); Gallacher (Blackburn Rovers), Durie (Rangers). Substitutes: T McKinlay (Celtic) for McNamara, 54; Booth (Borussia Dortmund) for Durie, 84.
MOROCCO (3-4-1-2): Benzekri (RS Settat); Triki (Lausanne), Naybet (Deportivo La Coruna), Abrami (Wydad Casablanca); Saber (Sporting Lisbon), Amzine (Mulhouse), El Khalej (Benfica), Chippo (Porto); Hadji (Deportivo La Coruna); Hadda (Club Africain), Bassir (Deportivo La Coruna). Substitutes: Rossi (Stade Rennes) for Saber, 72; Azzouzi (Greuther Furth) for Amzine, 77; Sellami (Raja Casablanca) for Chippo, 87.
Referee: A M Bujsaim (UAE).