Madrid remained part of Islamic al-Andalus until Alfonso VI of Castile captured it in 1083. It stayed a relatively modest town until King Philip II chose it as Spain's capital in 1561, transforming it from a small fortress into a purpose-built capital housing the Prado Museum and the Royal Palace, and cementing it as Spain's political and cultural center.