Phetchaburi is an old royal city, dating back to the Mon of the 8th century. Later Khmer settled in the city, as can be seen by the prangs of Wat Kamphaeng Laeng.
In 1860 King Rama IV built a palace near the city of Phetchaburi, commonly known as Khao Wang, but its official name is Phra Nakhon Khiri. Next to the palace the king built a tower for his astronomical observations. On the adjoining hill is the royal temple Wat Phra Kaeo