Known as Lavo during much of its history, Lopburi probably dates to prehistoric times.[1] The name Lavo originated in the Dvaravati period (6th–11th century CE). The conquering Khmer would build many impressive temples in the city during its rule. Lopburi may even have liberated itself for a time, as it sent independent embassies to China in 1115 and 1155. In 1289 it sent another embassy to China, but soon became part of the Thai kingdom of Sukhothai and later Ayutthaya.
During the Ayutthaya period, King Ramathibodi I sent Phra Ramesuan (later King Ramesuan) as the Uparaja to reign in Lopburi. In 1665 King Narai the Great ordered a new palace built on the east bank of the Lopburi River and made Lopburi the second capital of the country, as Ayutthaya was threatened by the Dutch. After King Narai died, the city was almost abandoned and fell into ruin.
In 1856 King Mongkut of the Chakri dynasty ordered King Narai's palace to be renovated. The city finally regained its importance in 1938, when Field Marshal Plaek Phibunsongkhram chose Lopburi to be the largest military base in Thailand.