In 1578, Ahmad's brother, Sultan Abu Marwan Abd al-Malik I, died in battle against the Portuguese army at Ksar-el-Kebir. Ahmad was named his brother's successor and began his reign amid newly won prestige and wealth from the ransom of Portuguese captives.