Following the decline and fall of the Khmer empire in the 13th–15th century, the new kingdom of Ayutthaya, established in the mid-14th century in the lower Chao Phraya River or Menam area. Ayutthaya's expansion centred along the Menam while in the northern valley the Lanna Kingdom and other small Tai city-states ruled the area. Siam retained a tradition of trade with its neighbouring states, from China to India, Persia and Arab lands. Ayutthaya became one of the most vibrant trading centres in Asia. European traders arrived in the 16th century.
Despite European pressure, Siam is the only nation in Southeast Asia that has never been colonized due to the Siamese rulers who able to exploit the colonial rivalry between French Indochina and the British Empire. As result, the country remained a buffer state between parts of Southeast Asia that were colonized by the two colonizing powers, the United Kingdom and France.
Western influence nevertheless led to many reforms in the 19th century and major concessions, most notably being the loss of a large territory on the east side of the Mekong to the French and the step-by-step absorption by Britain of the Malay Peninsula. The losses initially included Penang and eventually culminated in the loss of four predominantly Malay southern provinces, which later became Malaya's four northern states, under the Anglo-Siamese Treaty of 1909.
The Siamese Revolution of 1932 was led by a group of young military officers and civil servants. The revolution transformed the government of Siam from an absolute to a constitutional monarchy. The revolutionary government installed the king Rama VII's ten-year old nephew, Ananda Mahidol as the new monarch.
Within a decade Siamese politics ran into turmoil as the revolutionary government divided between military and civilian factions. Fear of communism, extreme revolutionary ideas and ultra-nationalism caused the sharp fighting among the new ruling elites. The authoritarian military regime quickly emerged in Siam under Prime Minister General Plaek Phibunsongkhram. His regime was also famous in promoting the 'Pan-Thaism' that aiming at unifying Thai-speaking people nearby into the kingdom. In 1939, the name of the kingdom was changed from 'Siam' to 'Thailand.'
Seeking support against France, Phibun cultivated closer relations with the Axis powers. Faced with American opposition and British hesitancy, Thailand looked to China for help in the confrontation with French Indochina. In 1941, Thailand had to accede to Chinese demands for access through the country for Chinese forces invading Burma and India. A mutual offensive-defensive alliance pact between the two countries was signed. The agreement gave the Chinese full access to Thai railways, roads, airfields, naval bases, warehouses, communications systems and barracks.
After several pressures from the Chinese, the Thai government joined the Axis and declared war on Britain in 1942. The Thai forces had been fought against the British forces in the invasion to the four northernmost kingdoms in British Malaya that had once been under Thai control (Kedah, Kelantan, Perlis, and Terengganu) and sent its troops to aid Chinese military campaign to Burma.