Founded by Chinese immigrant Mac Cuu in 1674, with the permission of the local Cambodian lords, Ha Tien thrived thanks to its position facing the Gulf of Thailand and astride the trade route between India and China. By the close of the seventeenth century, Siam (later Thailand) had begun to eye the settlement covetously, and Mac Cuu was forced to petition Hué for support. The resulting alliance, forged with Emperor Minh Vuong in 1708, ensured Vietnamese military backup, and the town continued to prosper. Mac Cuu died in 1735, but the familial fiefdom continued for seven generations, until the French took over in 1867. Subsequently, the town became a resistance flash-point, with Viet Minh holing up in the surrounding hills, and even sniping at French troops from the To Chau Mountain, to the south.