Rubuta ci gaba don wannan sakin layi - Tare da faduwar Faransa a 1940, a lokacin Yaƙin Duniya na II, Faransa ta kare Morocco ta shiga ƙarƙashin ikon gwamnatin Vichy, wanda ya sanya kansa na musamman. Sultan Muhammad V ba shi da sha'awar sababbin iyayensa. Kodayake gabaɗaya ba shi da iko, sultan ya ƙi buƙatun Vichy lokacin da zai iya, gami da rahoton da aka ƙi buƙatun Vichy a cikin 1941 don zartar da dokar anti-Yahudawa, yana da'awar cewa ba su dace da dokar Morocco ba. Muhammad V ya yi maraba da saukar da Allied a watan Nuwamba 1942
a Maroko, yana kin bin umarnin Vichy na matsar da fadarsa zuwa cikin kasa. Muhammad V ya karbi bakuncin shugabannin Allied Winston Churchill da Franklin Delano Roosevelt a taron Casablanca a watan Janairun 1943, a yayin da Churchill ya yaudari Roosevelt a kan wani yawon shakatawa zuwa Marrakesh. Kasancewar Allied a Maroko ya karfafa ƙungiyoyin kishin ƙasa, waɗanda aka kawo a ƙarƙashin sabuwar ƙungiyar laima, "Hizb al-Istiqlāl" (Jam'iyyar 'Yancin Kai) a cikin 1943. Koyaya, takardar neman Istiqlal ga Allied Powers da ke neman alƙawarin samun 'yancin kai na bayan yakin don Maroko ya yi amfani da hukumomin Faransawa' yanci don murkushe Istiqlal a 1944. Faransanci ya shafe kuma ya kama shugabannin ta a kan zargin da aka yi na taimaka wa kokarin yaki na Jamus, wanda ya haifar da zanga-zangar zanga-zanga a birane daban-daban waɗanda aka yi ta da karfi.