 Ma'mun was originally the Samanid governor of southern Khwarazm, with his capital at Gurganj.In 995 he invaded northern Khwarazm and deposed the last Afrigid Shah Abu 'Abdallah Muhammad (who was also a Samanid vassal), uniting the province under his rule.Upon his death in 997, his son Abu al-Hasan Ali succeeded him.