Although the site of Madrid has been occupied since prehistoric times, the first historical data we have from the city is from the middle of the IX Century, when Mohamed I ordered the construction of a small palace (site occupied now by the Palacio Real). Around this palace there was built a small citadel (al-Mudaina). Near that palace was the River Manzanares, which the muslims called Mayrit meaning source of water. (from which Magerit, then Madrid). The citadel was conquered in 1085 by Alfonso VI in his advance towards Toledo. He reconsecrated the mosque as the church of the Virgin of Almudena (almudin, the garrison's granary). In 1329 the Cortes first assembled in Madrid to advise Fernando IV. Jews and Moors continued to live in the city in their quarter, still called the "Moreria" until they were expelled.
Later, Madrid was taken by the followers of Enrique of Tastamara and ceded by Juan I to King Leon V of Armenia who was then dethroned by the Sultan of Babilonia. Having been destroyed by fire during the reign of Enrique II, the city was rebuilt by his grandson Enrique III, who reincorporated Madrid under the Crown of Castille and who also founded El Pardo, situated just outside the city.
Enrique VI gave Madrid the title of "Very Noble and Loyal" and celebrated here his magnificent wedding with Doña Juana of Portugal. The death of the king caused the formation of two distinct bands within the Castille kingdom - the two sides disputing the succession of the throne. Isabel and her supporters overcame Doña Juana's followers and the victorious "Catholic Kings" (Isabel and her husband Fernando) solemnly entered the city to reside in a mansion in the Plaza de la Paja owned by Don Pedro Lasso de la Vega.
During the war of Communities, the Borough of Madrid took sides with the "Comuneros", although this did not prevent Emperor Carlos V bestowing on the city the title of "Crowned and Imperial". As remnants of these times we can cite the Church of San Jerónimo, the Church of del Paso and the Tower of Lujanes, this last in the Plaza de la Villa, opposite the Ayuntamiento or City Hall where Francis I of France was held prisoner after his defeat at Pravia in Italy.
The kingdoms of Castilla, with its capital at Toledo, and Aragón, with its capital at Barcelona, were welded into modern Spain in the person of Carlos I. Though King Carlos favored Madrid, it was his son, Felipe II (1527-1598) who moved the Court to Madrid in 1561. Although he made no official declaration, the seat of the Court was the de facto capital. Madrid had no resemblance with other European capitals: the population of the city was economically dependent on the business of the court itself.
Madrid enjoyed significant changes during the 18th century, when city gates, bridges and new buildings gave it a new appearance. The Royal Palace (also called the Eastern Palace - Palacio de Oriente) was constructed on the site of the ruins of the Alcazar or old Moorish Castle which had been destroyed by fire in 1734. After 1738 Juan B. Sachetti directed the construction work on the Palace, helped out to some extent by Ventura Rodríguez and developing on original plans made by Juavera. The work was practically completed by 1760.
The reign of Carlos III (1759 - 1788) helped to greatly improve the appearance of the city. The work on the Royal Palace was totally completed (as we know it today), as was the construction of the city gates of Puerta de Toledo, Puerta de Segovia and Puerta de Alcalá, together with the Royal Theatre, the building that now houses the Ministry of Finance (Hacienda), the Natural Science Museum, the Botanical Gardens and the temple of San Francisco El Grande, amongst others. Also, the Retiro Park was significantly improved and several new buildings built: Casa de Cisneros, the General Hospital, the College of San Carlos, the Royal Mint, Casa de los Geranios and the fountains of Cibeles, Neptune and Apollo. Carlos III was one of the most popular kings in the history of Madrid, and the saying "the best mayor, the king" became popular during those times.
The reign of Carlos IV gave Madrid the Buenavista Palace (today the Ministry of Armed Forces) and other notable mansions such as that of the Dukes of Liria in Princesa Street and that of the Count of Altamira in Calle de la Flor.
On the 2nd of May 1808 a popular revolt started in the Puerta del Sol, initiating the War of Independence. There are numerous place names in Madrid dedicated to these patriotic disturbances, the most significant being of course the Plaza Dos de Mayo in Malasaña. Once General Castaños had repelled the invaders in Bailén, he entered Madrid on 23rd August 1808. However, there were further battles when Emperor Napoleon presented himself in Chamartín and also in December of the same year when José Bonaparte entered Spain, only to be expelled three years later under pressure from the Anglo-Hispanic army led by Wellington. The last of the French left Madrid on the 27th May 1813 and the following year King Fernando VII entered the city.
The city continued to be improved during the reign of Isabel II with old houses in the Puerta del Sol being pulled down and the Congreso de los Diputados or Parliament, Royal and Zarzuela Theatres and the Canal de Isabel II (Madrid's water lifeline) being built. Also, in 1857, Madrid's gas lighting system was inaugurated.
During the Catholic dictatorship of Francisco Franco, Madrid became very industrialized and there were massive migrations into the city. Since then Madrid's urban progress has accelerated to reach, today, the level of one of Europe's most beautiful capital cities - pleasing both for its intense animated spirit and its suitable mix of modern and classical appearance.
