Madrid has been the capital of Spain since 1562, and is located
at the geographic center of the Iberian Peninsula. Because of
its central location and high altitude, the climate of Madrid
is characterized by warm dry summers and cool winters.
Its name dates back to the Arab foundation of the city and is derived from Macher-it, mother of plentiful water. After the city was taken by the Christians, this word entered the Spanish language as Magerit, later changed to Madrit, and finally became Madrid.
In 852, Muhammad I erected a fortress on the site currently occupied by the Royal Palace, to defend Toledo from Christian incursions. Madrid became a Christian city in 1085 after Toledo was taken by Alphonse VI, and became the capital of Spain in 1562, when Philip II moved the court from Toledo.
In the 16th century, the city was known as Madrid de los Austrias, after the reigning Hapsburg dynasty. During this period the churches and private palaces were built. In the 17th century, Plaza Mayor was added and the Puerta del Sol (Gate of the Sun) became the spiritual heart of not only Madrid but all of Spain.
Madrid's attractions include three internationally acclaimed art galleries, the royal palace, many grand public squares, and many museums filled with treasures from Spain's history.