The first railway in what was then Siam opened in 1894 between Bangkok and Ayutthaya, a distance of 66km. It was contructed to metre gauge, as were all subsequent lines in the country.
The rail network has international connections with Laos and Malaysia. A link to Cambodia was severed in the 1970s but reinstated in 2016.
There was also formerly a line to Burma. Japanese forces constructed this line during World War II using the labour of Allied prisoners of war, many of whom lost their lives. The line fell into disuse at the end of the war, but a section of it (from the junction at Nong Pladuk as far as Nam Tok, including the famous - or infamous - Bridge over the River Kwai) has subsequently been reopened as part of the State network.
The present day national network consists of 4000km of metre gauge line; projects are in hand for double tracking and speeed improvements on much of the network, also some metre gauge extensions. The State Railway also owns the 29km Suvarnabhumi Airport Rail Link, which is intended become part of a network of standard (1435mm) gauge lines. The Bangkok Metro is also constructed to standard gauge.
In 2014, the government approved a memorandum of understanding with the Chinese government relating to the construction of two new standard gauge lines: a 734km line from the port of Map Ta Phut near Rayong in the south of the country to Nong Khai in the north, where it would eventually meet a standard gauge railway crossing Laos to China; and a 133km branch from the main line at Kaeng Khoi to the capital, Bangkok.
In 2018, government funding was approved for a new 326km railway from Den Chai on the Bangkok to Chiang Mai line to Chiang Khong near the border with Laos on the Mekong River.
Flag image from CIA World Factbook