This article deals with a vexing problem in the phonology of Moroccan Arabic, the alternation between [CɨCC] and [CCɨC] nouns. It is shown that this alternation cannot be predicted in all instances from the phonetic nature of the consonants, contrary to what has been claimed in previous analyses, and that it is necessary to have recourse to an analysis based on the notion of templates. It is claimed that the difference between the two forms [CɨCC] and [CCɨC] reflects an underlying difference between the three templates /CVCC/, CVCVC/, and /(ɂa)CCVC/, which are shared by both Classical Arabic and Moroccan Arabic. The influence of sonority is secondary and only accounts for the appearance of [CCɨC] forms in nouns derived from the template /CVCC/ whose last consonant is a nasal ([jbɨn] ‘cheese), a liquid ([bħɨr] ‘sea’), or a /ʕ/ ([zrɨʕ] ‘wheat’).