It's difficult to make any one sweeping statement about Madrid architecture. As Spain's monarchical dynasties shifted from Flanders to Austria to France, so did the principal styles that shaped every period. Madrid was rarely a trendsetter; rather the city tended to absorb foreign influences and adapt them, more often than not, to a somewhat austere Catholic aesthetic.
Little remains of pre-capital Madrid, as it was an insignificant town before Phillip II moved his court here (see Madrid history). Sections of the 10th century Arab wall, however, are being excavated next to the Palacio Real; you can see the rest on Cuesta de la Vega by following Calle Mayor to the end.
Medieval Madrid lives on in a handful of brick mudéjar towers. You can see them above the 12th century San Nicolás de los Servitas church (Calle de San Nicolás, off of Calle Mayor) and San Pedro el Viejo on Costanilla de San Pedro. Mudéjar refers style of buildings constructed by Muslims living on Christian lands in pre-Inquisition Spain.
Madrid Architecture under the Hapsburgs (16th-17th century)
The best way to understand this period's defining characteristics is to visit the Plaza Mayor. Its grey slate spires and brick-red facades are two keys to understanding the term coined "Castilian baroque." The most important constructions from this period are the Puente de Segovia, the Plaza Mayor, the Casa de la Villa (on Plaza de la Villa, calle Mayor) and, outside of Madrid, El Escorial. Just stroll around the "Austrias" neighborhood, also known as "La Latina" or "Madrid de los Hapsburgos," and you'll get a sense of what Madrid was like in its very beginnings.
Madrid Architecture under the Bourbons (18th-19th century)
Madrid architecture became more ornate under the Bourbon dynasty due to French and Italian influences. Pedro de Ribera's Hospice, now the Municipal Museum on calle Fuencarral (in the Malasaña neighborhood), perfectly exemplifies the evolution of the Castilian baroque style towards a more decorative aesthetic with its intricate pediment. Not far from the Municipal Museum lies the Conde Duque Cuartel, former barracks now used as a cultural center, another beautiful slice of Bourbon Madrid.
Around the same time in the 1730's, Italian architects Filippo Juvarra and Giambattista Sacchetti headed construction of the Royal Palace on the site where the Arab Alcázar once stood. (See tourism around the Plaza Mayor).
The most decisive figure in Madrid's architectural history was no one architect, but King Charles III. Nicknamed the "bricklayer king," Charles knew that Madrid paled in comparison to other great European capitals like Rome, Paris and London. So he set out to raise Madrid's status by expanding the city towards the green field (prado) below the barrio of Huertas. The wide Paseo del Prado, from Plaza de Cibeles to Puerta de Atocha, was to hold Spain's great Enlightenment institutions: the Museum of Natural Sciences (ultimately the Prado Museum), the Astronomical Observatory and the Botanical Gardens. All three remain to this day, flanked by the classically inspired fountains of Cibeles and Neptuno.
Bourbon expansion continued in the 19th century to bring us such emblematic buildings as the Royal Theater, Las Cortes, Banco de España, Casa de América and the mansions of the still wealthy neighborhood of Salamanca.
Madrid Architecture: 20th Century and Beyond
A stroll down Gran Vía amounts to an eclectic journey through early 20th century Madrid architecture, starting at Cibeles with the famous Correos, an astoundingly original post office; up to the Metrópolis building that splits Gran Vía with calle Alcalá; and all the way down past the Palacio de la Música movie theater, the Telefónica building and ending at Plaza de España.
Civil War destruction in the 1930's and many a fascist monstrosity leave us little of note until the return of democracy in 1975. Modern Madrid is defined by the Puerta de Europa, a pair of inclined towers at Plaza de Castilla, and the elegantly white Torre Picasso. The Reina Sofia Museum has a new glossy red addition that's worth checking out as well.