The Thais first began settling their present homeland in the 6th century, and by the end of the 13th century ruled most of the western portion. During the next 400 years, they fought sporadically with the Cambodians to the east and the Burmese to the west. Formerly called Siam, Thailand has never experienced foreign colonization. The British gained a colonial foothold in the region in 1824, but by 1896 an Anglo-French accord guaranteed the independence of Thailand. A coup in 1932 demoted the monarchy to titular status and established representative government with universal suffrage.