At one time the town was on the coast of the Gulf of Thailand. Over time the coast has moved 30 km (18 miles) away to the south, due to sedimentation coming down the Mae Klong (river). Ratchaburi remains an important commercial centre, however. Archeological discoveries show that the area was already settled in the Bronze Age, and the town itself is known to have existed for at least two thousand years. In the thirteenth century Ram Khamhaeng seized Ratchaburi and incorporated it into the Sukhothai Kingdom. Later it was an important trade centre in the Ayutthaya Kingdom. In 1768 the Burmese (who had recently destroyed Ayutthaya) were thrown out of Ratchaburi by King Taksin, and the town became part of Siam.