In 1665 King Narai the Great ordered a new palace built on the east bank of the Lopburi River and made Lop Buri 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.