The boundary area has historically switched back and forth between various Khmer and Thai empires. From the 1860s France began establishing a presence in the region, initially in modern Cambodia and Vietnam, and later Laos, with the colony of French Indochina being created in 1887. In 1867 a Franco-Thai treaty confirmed Thai ownership of the Battambang and Angkor (Nakhou Siemrap) regions. In 1896 Britain (based in Burma) and France agreed to leave Siam (the then name for Thailand) as a buffer state between their respective colonies. However France continued to expand at the expense of Siam, annexing northern Cambodia in 1904 and then Battambang, Sisophon and Siam Nakhon/Siem Reap in 1907, whilst ceding Trat to Siam. The modern Cambodian-Thai border was as such delimited through several treaties between France and Siam between 1867 and 1907. Following Japan's invasion of French Indochina in 1940 the areas ceded to France in 1904 and 1907 were returned to Thailand, however this was reversed following Japan’s defeat and the pre-war border restored in 1946.