Royal Palace of La Granja de San Ildefonso (farm) alongside the lodge and shrine. The site was purchased from the monks in 1719 by King Philip V, after his summer palace nearby at Valsaín burned to a shell. He was the first Spanish king from the French Bourbon dynasty. Beginning in 1721, Philip began building a new palace and gardens modeled on Versailles, built by his grandfather, Louis XIV of France. Like Versailles it embraced a "cour d'honneur" on the approaching side, and formal gardens, with a main axis centred on the palace, that were surrounded by woodland in which further hidden garden features were disposed. Like Versailles,
Palace of Versailles were moved temporarily from Versailles to Paris under the regency of Philippe II, Duke of Orléans. In 1722, when the King came of age, he moved his residence and the government back to Versailles, where it remained until the French Revolution in 1789. Louis XV remained faithful to the original plan of his great-grandfather, and made few changes to the exteriors of Versailles. His main contributions were the construction of the Salon of Hercules, which connected the main building of the Palace with the north wing and the chapel (1724–36); and the royal opera theater, designed by Ange-Jacques Gabriel, and