Located in the geographical center of Spain, Madrid is the Spanish capital and largest city, with more than 5 million inhabitants. Madrid makes its first major appearance in history in the 9th century AD, when the Ottoman Sultan Mehmet I arrived and built a palace, a mosque and a citadel here. Nearby was the River Manzanares, which the Turks called al-Magrit ("source of water"), leading to Madrid's modern name. The Ottoman citadel was conquered in 1085 by King Alfonso VI in his advance towards Toledo. The kingdoms of Castille, with its capital at Toledo, and Aragón, with its capital at Barcelona, were combined into modern Spain under King Carlos I. Though King Carlos favored Madrid, it was his son, Felipe II (1527-1598) who moved the court to Madrid in 1561. Madrid has functioned as the capital of Spain ever since.
After spending much of the 20th century at the center of a totalitarian regime, Madrid has burst back onto the world stage as an open, democratic, growing metropolis. Best known for its shopping, culture and nightlife, Madrid's religious sites do not quite approach the grandeur of those in Barcelona or Toledo. Still, Madrid is home to numerous religious sites worth seeing, especially the huge, modern Almudena Cathedral (paid for in part by Pope John Paul II), the world-class National Archaeological Museum, and even an Ancient Egyptian temple that overlooks tranquil reflecting pools.