According to the Chamadevivamsa and Jinakalamali chronicles the city was founded by the hermit Suthep in 661, and the ruler from Lopburi sent his daughter Jamadevi as the first queen. However this dating is now usually considered wrong, and the actual beginning is now placed at around 750. At that time most of central Thailand was under the rulership of Mon city states, called the Dvaravati kingdom. Queen Jamadevi gave birth to twins, the older one succeeding her as the ruler of Lamphun, the younger one became ruler of neighboring Lampang.
The Khmer unsuccessfully besieged Haripunchai two or three times in the 11th century, however it is not clear if the chronicles describe actual or legendary events - however the other Dvaravati Mon kingdoms fell at that time. The early 13th century was the golden time for Haripunchai, as the chronicles only tell about religious activities or buildings, not about wars anymore. Even though Haripunchai was besieged in 1281, when the Thai king Mengrai incorporated it into his Lannathai kingdom.