Little is known about the origins of the earliest inhabitants of Thailand. Before the 13th century, a number of small principalities were controlled by the Khmer empire, which was centred in Angkor, in present-day Cambodia. In 1238, the Thais forced the Khmers from the northern plains and founded the Kingdom of Sukhothai (Dawn of Happiness), under King Inthratit. His son, Ramkamhaeng, established Buddhism as the common faith. 

In 1351, King Ramathibodi I founded the Kingdom of Ayuthaya, south of Sukhothai, near present-day Bangkok. He and his successors expanded Ayuthaya's influence north toward Sukhothai and east toward Angkor. The city of Ayuthaya was famous for its golden temples, royal palaces and canals. 

In the 1760s, the Burmese attacked and destroyed Ayuthaya. They melted down its golden Buddhas, sacked the treasury and burned most buildings to the ground. Thais who were unable to escape were killed or enslaved. The royal family was taken back to Burma. After 14 months of fighting, the Thais under Phya Tak Sin finally forced the Burmese out, but by then, Ayuthaya was in ruins. 

Phya Tak Sin established a new capital called Thonburi on the Chao Phya River and expanded Thai influence over Laos and Cambodia. In 1782, Phya Tak Sin was forced from the throne and one of his military leaders, Chao Phya Chakri, became King Rama I, founding the current Chakri dynasty. He established the city of Bangkok and revived much of the Ayuthaya culture.

In the 19th century, Rama II established trade and cultural relations with other countries, including China, Portugal, the United States and Great Britain. Rama IV (King Mongkut) worked to modernize the country and strengthen the economy. Rama V (King Chulalongkorn), the first king to travel to Europe, abolished slavery and established schools and hospitals. Siam (as the country was known) was never colonized by a foreign power, but King Chulalongkorn made treaties in the late 19th century that ceded land in Malaysia to the British, and land in Laos and Cambodia to the French.

 In 1932, during the reign ofRama VII, absolute monarchy was replaced by a constitutional monarchy. The right to vote was given to all adult Thais, both men and women. In 1939, the country changed its name to Prathet Thai (Thailand), meaning "the Land of the Free." During the Second World War, Thailand was forced to support the Japanese against the Allies, but many Thais actively resisted Japanese domination. 

  Did you know?
During the Second World War, Japan forced 200,000 Asian labourers and prisoners of war to build a bridge over the River Kwai to ensure a supply route to Burma. They worked under inhumane conditions on almost impassable ground. By the time the bridge was finished, more than 100,000 workers had died. The route was called the "Death Railway."
Since the war, quasi-military governments and a strong bureaucracy have administered the country. Thailand's economy, which was one of the strongest in southeast Asia, suffered during the Asian currency crisis in the late 1990s. Today, the country is working to rebuild its economy.