In 479/1086, Ibn Tashefin led his first campaign in Andalusia where he defeated the Christians in the famous Battle of Sagrajas. After that, Almoravids fought several battles against the Kings of Sects until they were able to secure control all over Andalusia in 486/1094. Ibn Abbad was exiled to Maghrib and he died in his prison.
When Ibn Tashefin, the Prince of the Muslims, ruled all over Andalusia, he and his following sons became designated as kings. He was able to gather all the great knights and scholars in the palace.
He also continued the invasion and suppression of the Christians. He worked very hard for the interest of Andalusia until he died in the months of year 493/1099.
His son, Ali Ibn Yusuf Ibn Tashefin, who also took the same title as his father, the Prince of the Muslims, continued his father's work in scaring his enemy and protecting the country. He was described as having good ethics, and he was closer to ascetics than he is as a king.