Muslims entered Spain through North Africa in 711 and established their capital in Cordoba, which remained the capital for 300 years. During the 10th century, Cordoba was a center of science in Europe with flourishing studies of philosophy, medicine, agriculture, and astronomy. The Alhambra palace complex in Granada featured gardens, fountains, and verses from the Quran on its walls. Muslim rule in Spain lasted from 711 to 1492, when the last Muslim king surrendered the keys to the city of Granada to the Catholic monarchs Ferdinand and Isabella.