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 when the enemies of the King's chief minister, Cardinal Richelieu, aided by the King's mother, Marie de' Medici, tried to take over the government. The King defeated the plot and sent his mother into exile. After this event, Louis XIII decided to make his hunting lodge at Versailles into a château. The King purchased the surrounding territory from the Gondi family, and in 1631–1634 had the architect Philibert Le Roy replace the hunting lodge with a château of brick and stone with classical pilasters in the doric style and high slate-covered roofs, surrounding the courtyard of the original hunting lodge.