The Royal Palace of Madrid () is the official residence of the Spanish royal family and is used primarily for state ceremonies. With over of floor space and 3,418 rooms, the Royal Palace of Madrid is the largest palace in Western Europe, the largest royal palace in Europe, and among the largest palaces in the world.

The palace is located on Bailén Street in the western part of central Madrid, east of the Manzanares River, and is accessible from Ópera metro station. The former Alcázar of Madrid, built on the site of a bygone Muslim-era fortress dating to the 9th century, served both as a secure repository for the royal treasure and as a habitual residence of the Trastámara monarchs in the late Middle Ages. After undergoing substantial expansion works during the 16th century, the Royal Alcázar remained on the site until it burned down on 24 December 1734. A new, larger and more sumptuous palace was then built from scratch on the same site for the Bourbon dynasty. Construction took place between 1738 and 1755, and followed a Berniniesque design by Filippo Juvarra and Giovanni Battista Marchetti, in cooperation with Ventura Rodríguez, Francesco Sabatini, and Martín Sarmiento. During the Second Spanish Republic, the building was known as the Palacio Nacional.

The exterior of the palace is characterized by a late Baroque classicism. The main façade, facing the Plaza de la Armería, rises above a rusticated base and is articulated by giant-order columns and pilasters, with a contrast between grey granite and white limestone. The palace is framed by several ceremonial and landscaped spaces, including the Plaza de Oriente, the Sabatini Gardens beside its northern façade, and the Campo del Moro gardens to the west.

The interior of the palace is notable for its wealth of art and the use of many types of fine materials in the construction and decoration of its rooms. Among its many rooms are the Main Staircase, the Throne Room, the Hall of Halberdiers, the Hall of Columns, the State Dining Room, the Rococo Gasparini Room, the Royal Chapel, the Royal Library, the Royal Pharmacy, and other rooms of historical and artistic interest. The decoration also includes paintings by artists such as Caravaggio, Juan de Flandes, Francisco de Goya, and Diego Velázquez, and frescoes by Giovanni Battista Tiepolo, Corrado Giaquinto, and Anton Raphael Mengs.

Other collections of great historical and artistic importance preserved in the building include the Royal Armoury of Madrid, which houses one of the most important and largest collections of arms and armours; porcelain, watches, furniture, silverware, and the world's only complete Stradivarius string quintet.

History of the building

The original palace The palace was initially built by Muhammad I, Umayyad Emir of Cordoba, between 860 and 880. After the Moors were driven out of Toledo in the 11th century, the castle retained its defensive function. Henry III of Castile added several towers. His son John II used it as a royal residence. During the War of the Castilian Succession (1476) the troops of Joanna la Beltraneja were besieged in the alcázar, during which the building suffered severe damage.

The only drawing of the castle from the Middle Ages is one from 1534 by Jan Cornelisz Vermeyen.

Emperor Charles V, with the architects Alonso de Covarrubias and Luis de Vega, extended and renovated the castle in 1537. Philip II made Madrid his capital in 1561 and continued the renovations, with new additions. Philip III and Philip IV added a long southern façade between 1610 and 1636.

Philip V of Bourbon renovated the royal apartments in 1700. The alcázar of the Habsburgs was austere in comparison to the Palace of Versailles where the new king had spent his childhood; and he began a series of redesigns mainly planned by Teodoro Ardemans and René Carlier, with the main rooms being redecorated by Queen Maria Luisa of Savoy and the Princess of Ursins in the style of French palaces.

On Christmas Eve 1734, the alcázar was destroyed by a fire that originated in the rooms of the French painter Jean Ranc. Response to the fire was delayed due to the warning bells being confused with the call to mass. For fear of looting, the doors of the building remained closed, hampering rescue efforts. Some works of art were lost, including the Expulsion of the Moors by Diego Velázquez. Others, such as , were rescued by tossing them out the windows. Fortunately, many pieces were saved because shortly before the blaze the King ordered that much of his collection be moved to the Buen Retiro Palace. The fire lasted for four days and completely destroyed the old alcázar, whose remaining walls were finally demolished in 1738.

The baroque palace

Philip V commissioned the construction of a new palace.Royal Palace of Madrid, "Visit to the Palace" leaflet For its reconstruction, Italian architect Filippo Juvarra oversaw work on the new palace and devised a lavish project inspired by Bernini's plans for the Louvre in Paris. Initially Juvarra wanted to build the palace in another location; however, the idea was discarded. His disciple Giambattista Sacchetti, also known as or Giovanni Battista Sacchetti, was chosen to continue the work of his mentor. Sacchetti designed the structure to encompass a large square courtyard and resolved sightline problems by creating projecting wings.

In 1760, Charles III called upon Sicilian Francesco Sabatini, a Neoclassical architect, to enlarge the building. Sabatini's original idea was to frame the Plaza de la Armería with a series of galleries and arcades, to accommodate various dependencies, by constructing two wings along the square. Only the extension of the southeast tower known as la de San Gil was completed. Sabatini also planned to extend the north side with a large wing that echoed the style of the main building and included three square courtyards that would be smaller than the large central courtyard. Work on this expansion started quickly but was soon interrupted, leaving the foundations buried under a platform on which the royal stables were later built. The stables were demolished in the 20th century and replaced by the Sabatini Gardens. Charles III first occupied the palace in 1764.

In the 19th century, Ferdinand VII, who spent many years imprisoned in the Château de Valençay, began the most thorough renovation of the palace. The aim of this redesign was to turn the old-fashioned Italian-style building into a modern French-style palace. However, his grandson Alfonso XII proposed to turn the palace into a Victorian-style residence. Alfonso's plans were designed by the architect José Segundo de Lema and consisted of remodeling several rooms, replacing marble floors with parquet, and adding period furniture.

In the twentieth century, restoration work was needed to repair damage suffered during the Spanish Civil War, by repairing or reinstalling decoration and decorative trim and replacing damaged walls with faithful reproductions of the originals.

The wedding banquet of Prince Felipe and Letizia Ortiz took place on 22 May 2004 in the central courtyard of the palace.

The palace is owned by the Spanish state and administered by the Patrimonio Nacional (English: National Heritage), a public agency of the Ministry of the Presidency, Justice and Relations with the Cortes. It is now open to the public, except during state functions, although it is so large that only a selection of rooms are on the visitor route at any one time, the route being changed every few months. An admission fee is charged; however, at some times it is free.

Exterior

The main façade of the palace, the one facing the Plaza de la Armeria, consists of a two-story rusticated stone base, from which rise Ionic columns on Tuscan pilasters framing the windows of the three main floors. The upper story is hidden behind a cornice which encircles the building and is capped with a large balustrade. This was adorned with a series of statues of saints and kings, but these were relocated elsewhere under the reign of Charles III to give the building a more classical appearance.

The restoration of the façade in 1973, which includes Sabitini's balcony of four Doric columns, returned some of Sachetti's sculptures. These include statues of the Aztec ruler Moctezuma II and the Inca emperor Atahualpa, works by Juan Pascual de Mena and Domingo Martínez, respectively. Representations of the Roman emperors Honorius, Theodosius I, and Arcadius by G.D. Olivieri, and Trajan by Felipe de Castro were placed in the Prince's courtyard. Flanking Sabatini's clock the Statues of Philip V, Ferdinand VI, Barbara of Braganza and Maria Luisa of Savoy interspersed with The Rising Sun Following the Zodiac. Above the clock is the royal coat of arms flanked by angels, and, above that, bells that date from 1637 and 1761.

Plaza de la Armería

The square as it exists now was laid out in 1892, according to a plan by the architect Enrique María Repullés. However, the history of this square dates back to 1553, the year in which Philip II ordered a building to house the royal stables.

The Almudena Cathedral faces the palace across the plaza. Its exterior is neo-classical to match its surroundings while its interior is neo-gothic. Construction was funded by King Alfonso XII to house the remains of his wife Mercedes of Orléans. Construction of the church began in 1878 and concluded in 1992.

Narciso Pascual Colomer, the same architect who crafted the Plaza de Oriente, designed the layout of the plaza in 1879, but failed to materialize. The site now occupied by the Plaza de la Armería was used for many decades as anteplaza de armas. Sachetti tried to build a cathedral to finish the cornice of the Manzanares, and Sabatini proposed to unite this building with the royal palace, to form a single block. Both projects were ignored by Charles III.

Ángel Fernández de los Ríos in 1868 proposed the creation of a large wooded area that would travel all around the Plaza de Oriente, in order to give a better view of the Royal Palace. A decade later Segundo de Lema added a staircase to the original design of Fernández, which led to the idea of Francisco de Cubas to give more importance to the emerging church of Almudena.

Plaza de Oriente The Plaza de Oriente is a rectangular park that connects the east façade of Palacio Real to the Teatro Real. The eastern side of plaza is curved and bordered by several cafes in the adjoining buildings. Although the plaza was part of Sacchetti's plan for the palace, construction did not begin until 1808 when King Joseph Bonaparte, who ordered the demolition of approximately 60 medieval structures, that included a church, monastery and royal library, located on the site. Joseph was deposed before construction was completed; it was finished by Queen Isabella II, who tasked the architect Narciso Pascual Colomer with creating the final design in 1844.

Pathways divide the Plaza into three main plots: the Central Gardens, the Cabo Noval Gardens and the Lepanto Gardens. The Central Gardens are arranged in a grid around the central monument to Philip IV, following the Baroque model garden. They consist of seven flowerbeds, each bordered with box hedges and holding small cypress, yew and magnolias and annual flowers. The north and south boundaries of the Central Gardens are marked by a row of statues, popularly known as the Gothic kings— sculptures representing five Visigoth rulers and fifteen rulers of the early Christian kingdoms in the Reconquista. They are carved from limestone, and are part of a series dedicated to all monarchs of Spain. These were ordered for the decoration of the Palacio Real and were executed between 1750 and 1753. Engineers felt the statues were too heavy for the palace balustrade, so they were left on ground level where their lack of fine detail is readily apparent. The remainder of the statues are in the Sabatini Gardens.