Spain had been ruled by the Visigoths from about 500. In 711 Muslims from Africa called Moors moved into southern Spain and had conquerored all of it by 718. They then moved into France but Charles Martel led an army against them in and beat them in the Battle of Tours (or Poitiers) 732, driving them back into southern Spain. The Moors created a Muslim kingdown called al-Andalus. In 1037 the Christian kingdoms of Leon and Castile were united. In 1139 the kingdom of Portugal was created.