Finally he retired to the Almoravid court at Fez, where he was poisoned in 1138.
Thus was the Almoravid dynasty established, with its capital at Cordova, and which lasted until 1147.
The Almoravid princes who founded Marrakech came from the black desert of Senegal; themselves were leaders of wild hordes.
It was no longer the glorious city of the days before the Almoravid conquest.
Later in life he visited Cordova, already in its decline through the illiberal government of the Almoravid dynasty.