Morocco’s origins trace back to the Idrissid dynasty in 789 CE, which established the first major Islamic state in the region. The modern independent kingdom emerged much later, on March 2, 1956, when France and Spain ended their protectorates and recognized Moroccan sovereignty.