MAS goalkeeper Anas Zniti was the hero as his Moroccan side won the Confederation Cup by beating Tunisia's visiting Club Africain 6-5 on penalties.
The hosts won the second leg of the final 1-0 thanks to a goal from Malian Moussa Tigana that made it 1-1 on aggregate, so taking the game straight to penalties.
Zniti saved two Club Africain spot kicks before stepping up himself to score the tournament-winning penalty.
MAS's first continental success means that the trophy stays in Morocco, after FUS Rabat surprised many by winning last year's event.
Hosts MAS had dominated the game and Club Africain had to hold on at the end as they played the last 30 minutes with ten men.
MAS thought they had taken the lead 10 minutes before half-time when a fierce drive from Tigana hit the bar and bounced down but the referee decided it had not crossed the line.
Replays seemed to suggest that the ball did go over the line - and so a goal should have been awarded.
But Tigana did find the net three minutes into injury time at the end of the first half as he shot home after Club Africain's Aymen Ben Ayoub failed to hold on to a ball that bounced up towards him.
MAS continued to make the running in the second half and with the way Club Africain tackles were flying in, it was only a matter of time before there was a dismissal.
It came on the hour as Chadian Ezechiel Ndouassel was given his marching orders for violent conduct, and afterwards the Tunisian side appeared to play better with 10 men - but without finding an all-important equaliser.
In the dramatic shoot-out, both sides had one of their first five attempts saved before it went to sudden death.
Zniti had been unlucky not to stop two more attempts before he saved Club Africain's seventh spot kick before then scoring the winning penalty himself.
It was a measure of revenge for Morocco over Tunisia, who came out on top in this year's African Champions League final when Esperance narrowly beat Wydad Casablanca 1-0 on aggregate last month.
Moroccan and Tunisian clubs are now all square in the Confederation Cup with three titles apiece, while teams from Ghana and Mali have been successful once.
MAS win $660,000 and will take on Esperance in the African Super Cup next season, with the match likely to be played in February.