Chiang Mai (/ˌtʃæŋ ˈmaɪ/, from Thai: เชียงใหม่ [tɕʰīəŋ màj] (listen), Northern Thai: ᨩ᩠ᨿᨦ ᩲᩉ᩠ᨾ᩵ [t͡ɕīəŋ.màj] (listen)) sometimes written as "Chiengmai" or "Chiangmai" is the largest city in northern Thailand. It is the capital of Chiang Mai Province and was a former capital of the kingdom of Lan Na (1296–1768), which later became the Kingdom of Chiang Mai, a tributary state of Siam from 1774 to 1899, and finally the seat of princely rulers until 1939. It is 700 km (435 mi) north of Bangkok near the highest mountains in the country. The city sits astride the Ping River, a major tributary of the Chao Phraya River.