Phatthalung, a province in southern Thailand, has a rich history tracing back to prehistoric times. Archaeological discoveries, including polished stone axes found in various districts, suggest early human settlement. During the Srivijaya period (7th–8th centuries AD), Phatthalung became a cultural center heavily influenced by Indian Mahayana Buddhism, as evidenced by clay Bodhisattva figures and deity sculptures found in the Khao Kuha Sawan and Khao Ok Thalu caves.
By the 15th century, Phatthalung had established itself under the Ayutthaya Kingdom, achieving status as a third-tier city and a southern outpost. Early records indicate that the city’s original location was in modern-day Sathing Phra, Songkhla Province, but frequent pirate raids, especially by the Raja Aru and Ujung Kata groups, forced repeated defenses and relocations.
In the reign of King Songtham, Dato Mogol, a Muslim trader from the Javanese island of Saleh and an ancestor of Sultan Sulaiman of Songkhla, settled at Khao Daeng. He established a peaceful Muslim community, attracting settlers and facilitating trade. Over time, this area evolved into a significant port city with regular Chinese trading ship visits, benefiting from its status as a duty-free port.