El Escorial, or the Royal Site of San Lorenzo de El Escorial (Spanish: Monasterio y Sitio de El Escorial en Madrid), or Monasterio de El Escorial (Spanish pronunciation: [el eskoˈɾjal]), is a historical residence of the king of Spain located in the town of San Lorenzo de El Escorial, 2.06 kilometres (1.28 mi) up the valley (4.1 km [2.5 mi] road distance) from the town of El Escorial and about 45 kilometres (28 mi) northwest of the Spanish capital Madrid. Built between 1563 and 1584 by order of King Philip II (who reigned 1556–1598), El Escorial is the largest Renaissance building in the world. It is one of the Spanish royal sites and functions as a monastery, basilica, royal palace, pantheon, library, museum, university, school, and hospital.
El Escorial consists of two architectural complexes of great historical and cultural significance: the royal monastery itself and La Granjilla de La Fresneda, a royal hunting lodge and monastic retreat about five kilometres (3.1 mi) away. These sites have a dual nature: during the 16th and 17th centuries, they were places in which the power of the Spanish monarchy and the ecclesiastical predominance of the Roman Catholic religion in Spain found a common architectural manifestation. El Escorial was both a Spanish royal palace and a monastery. Established with a community of Hieronymite monks, it has become a monastery of the Order of Saint Augustine. It also contained a boarding school, now the Real Colegio de Alfonso XII, still in operation.