Thai people, who originally lived in southwestern China, migrated into mainland Southeast Asia over a period of many centuries. The oldest known mention of their existence in the region by the exonym Siamese is in a 12th-century inscription at the Khmer temple complex of Angkor Wat in Cambodia, which refers to syam, or "dark brown", people. It was believed that Siam derived from Sanskrit śyāma or "brown (people)" with a contemptuous signification. Chinese: 暹; pinyin: Xiān was the name for the northern kingdom centered on Sukhothai and Sawankhalok, but to the Thai themselves, the name of the country has always been Mueang Thai.
The country's designation as Siam by Westerners likely came from the Portuguese, the first Europeans to give a coherent account of the country. Portuguese chronicles noted that the Borommatrailokkanat, king of the Ayutthaya Kingdom, sent an expedition to the Malacca Sultanate at the southern tip of the Malay Peninsula in 1455. Following their conquest of Malacca in 1511, the Portuguese sent a diplomatic mission to Ayutthaya. A century later, on 15 August 1612, The Globe, an East India Company merchantman bearing a letter from King James I, arrived in "the Road of Syam". "By the end of the 19th century, Siam had become so enshrined in geographical nomenclature that it was believed that by this name and no other would it continue to be known and styled."
Indianized kingdoms such as the Mon, the Khmer Empire and Malay states of the Malay Peninsula and Sumatra had ruled the region. The Thai established their own states: Ngoenyang, the Sukhothai Kingdom, the Kingdom of Chiang Mai, Lan Na and the Ayutthaya Kingdom. These states fought each other and were under constant threat from the Khmers, Burma and Vietnam. Much later, the European colonial powers threatened in the 19th and early 20th centuries, but Thailand survived as the only Southeast Asian state to avoid European colonial rule because the French and the British decided it would be a neutral territory to avoid conflicts between their colonies. After the end of the absolute monarchy in 1932, Thailand endured sixty years of almost permanent military rule before the establishment of a democratically elected-government system. In 2014 there was a coup d'état, see 2014 Thai coup d'état.