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,
King Narai's Palace of Rattanakosin ordered the restoration of King Narai's Palace. He built a new throne hall complex (Phiman Monkut Pavilion) for his stay in 1856. He also renamed the palace "Phra Narai Rajanivet". During King Chulalongkorn's (Rama V) reign, Phiman Mongkut Pavilion, which had been King Mongkut's accommodations, was given to the government to use as the Lopburi City Hall. On October 11, 1924, Prince Damrong Rajanubhab and Prince Narisara Nuvadtivongs opened the Chantarapisarn Pavilion in King Narai's palace as a museum, calling it the Lopburi Museum. Later, in 1961 the name of the museum was changed to "Somdet Phra Narai