The Royal Palace of Madrid is the official residence of the Spanish Royal Family at the city of Madrid, but it is only used for state ceremonies. King Felipe VI and the Royal Family do not reside in the palace, choosing instead the more modest Palace of Zarzuela on the outskirts of Madrid.
The palace is located on the site of a 9th-century Alcázar (“Muslim-era fortress”), near the town of Magerit, constructed as an outpost by Muhammad I of Córdoba and inherited after 1036 by the independent Moorish Taifa of Toledo. After Madrid fell to King Alfonso VI of Castile in 1083, the edifice was only rarely used by the kings of Castile. In 1329, King Alfonso XI of Castile convened the cortes of Madrid for the first time. King Felipe II moved his court to Madrid in 1561.