Following the death of Emperor Askia Daoud, a civil war of succession weakened the Empire, leading Sultan Ahmad I al-Mansur of the Saadi Dynasty of Morocco to dispatch an invasion force (years earlier, armies from Portugal had attacked Morocco, and failed miserably, but the Moroccan coffers were on the verge of economic depletion and bankruptcy, as they needed to pay for the defenses used to hold off the siege) under the eunuch Judar Pasha.