Although the Royal family do not reside here, the Palacio Real de Madrid (Royal Palace of Madrid) remains the official residence of the Spanish monarchy and is used for state occasions. The site of the palace dates from a 10th-century fortress, called mayrit, constructed as an outpost by Mohammed I, Emir of Córdoba and inherited after 1036 by the independent Moorish Kingdom of Toledo. After Madrid fell to Alfonso VI of Castile in 1085, the edifice was only rarely used by the kings of Castile. Philip II moved his court to Madrid in 1561.
The Antiguo Alcázar was built on the location in the 16th century. It burned on December 24, 1734; King Philip V ordered a new palace built on the same location. Construction spanned from 1738 to 1755, according to the designs of Juan Bautista Sachetti in cooperation with Ventura Rodríguez, Sabatini, and Scirmento. The new palace was occupied by Carlos III in 1764. The palace is the largest in all of Western Europe, occupying an area of 135,000 square metres. It is richly decorated by artists such as Velázquez, Tiepolo, Mengs, Gasparini, Juan de Flandes, Caravaggio, and Goya.