It was originally known as Lavo or Lavapura, meaning "city of Lava" in reference to the ancient South Asian city of Lavapuri (present-day Lahore).
The city has a history dating back to the Dvaravati period more than 1,000 years ago. According to the Northern Chronicles, it was founded by King Kalavarnadish (Thai, "Phraya Kalavarnadit"), who came from Taxila (Takkasila) in north-west India (now Pakistan) in 648 CE. Lopburi, or Lavapura as it then was, was under the rule of the rising Angkor regime and became one of the most important centers in the Chao Phraya Basin from then on. Epigraphic evidence indicates that the dominant population of the city was Mon.
The earliest confirmed occurrence of the name Lavapura is on silver coins inscribed "lava" on the obverse and "pura" on the reverse in a Pallava-derived script of the seventh or eighth century; several such coins were recovered in 1966 from a hoard found in an ancient jar in U Thong.
There is some evidence the Khmer Empire, under Suryavarman II, fought against the Mons in the 12th century over suzerainty. Lopburi sent embassies to China in 1115 and 1155.
Lopburi (Lavo) is described in Book III of Marco Polo’s Travels, where it is called Locach. This came from the Chinese (Cantonese) pronunciation of Lavo, "Lo-huk". The city is referred to as "Lo-ho" in chapter 20 of the History of Yuan (元史 : Yuán Shǐ), the official history of the Mongol, or Yuan Dynasty of China. Due to a scribal error in Book III of Marco Polo’s travels treating of the route southward from Champa, where the name Java was substituted for Champa as the point of departure, Java Minor was 1,300 miles to the south of Java Major, instead of from Champa, on or near an extension of the Terra Australis. As explained by Sir Henry Yule, the editor of an English edition of Marco Polo's Travels: "Some geographers of the 16th century, following the old editions which carried the travellers south-east of Java to the land of Boeach (or Locac), introduced in their maps a continent in that situation".
After the foundation of the Ayutthaya Kingdom in the 14th century, Lopburi was a stronghold of Ayutthaya's rulers. It became the capital of the kingdom during the reign of King Narai the Great in the mid-17th century and the king resided there about eight months a year.
Lopburi lies on the Lopburi River at an elevation of 20 metres (66 ft) mostly surrounded by alluvial plains, although some hills rise to between 300 metres (980 ft) and 600 metres (2,000 ft) to the north-east.
Lopburi has a tropical savanna climate (Köppen climate classification Aw). Winters are dry and very warm. Temperatures rise until April, which is very hot with the average daily maximum at 36.8 °C (98.2 °F). The monsoon season runs from late April through October, with heavy rain and somewhat cooler temperatures during the day, although nights remain warm.
The main road through Lobpuri is Route 1 (Phahonyothin Road), which starts in Bangkok, and continues through Lopburi, Chai Nat, Nakhon Sawan, Kamphaeng Phet, Tak, Lampang, Chiang Rai, and the border with Burma at Mae Sai. Route 311 leads west to Sing Buri, and Route 3196 leads south-west to Ang Thong.
Lopburi is a station of the State Railway of Thailand's Northern Line, forming the end of Bangkok's suburban service.
Lopburi is served by the Khok Kathiam airport, 9 kilometres (5.6 mi) north of the town.
Today the city is best known for the hundreds of crab-eating macaques (Macaca fascicularis) that live in the middle of the city, especially around the Khmer temple, Prang Sam Yot and a Khmer shrine, Sarn Phra Karn. They are fed by the local people, especially during the Monkey Festival in November. Because they are not afraid of humans, they steal whatever items or food they can find from unwary visitors.
In the city signs are posted reading: To prevent monkeys attacking people, the officer will feed monkeys in 3 designated areas outside San Phrakan twice a day, at 10am and 4pm. Those who want to feed monkeys other than these times, please contact the officer or caretaker.
Prang Sam Yot, originally a Hindu shrine, has three prangs that represent Brahma, Vishnu, and Shiva (the Hindu trinity). It was later converted to a Buddhist shrine.