to the king directly, as there was a bell in front of the palace for this purpose. The city briefly dominated the area under King Ram Khamhaeng, who tradition and legend states established the Thai alphabet, but after his death in 1365, Sukhothai fell into decline and became subject to another emerging Thai state, the Ayutthaya Kingdom in the lower Chao Phraya area. Another Thai state that coexisted with Sukhothai was the eastern state of Lan Na centred in Chiang Mai. King Mangrai was its founder. This city-state emerged in the same period as Sukhothai. Evidently, Lan Na became closely allied with Sukhothai. After the Ayutthaya Kingdom had emerged and expanded its influence from the Chao Phraya valley, Sukhothai was finally subdued. Fierce battles between Lan Na and Ayutthaya also constantly took place and Chiang Mai was eventually subjugated, becoming Ayutthaya's vassal. Lan Na's independent history ended in 1558, when it finally fell to the Burmese. It was dominated by Burma until the late-18th century. Local leaders then rose up against the Burmese with the help of the rising Thai kingdom of Thonburi of King Taksin. The "Northern City-States" then became vassals of the lower Thai kingdoms of Thonburi and Bangkok. In the early 20th century they were annexed and became part of modern Siam, the country that is now called "Thailand". Ayutthaya period (1351–1767) The city of Ayutthaya was on a small island, encircled by three rivers. Due to its defensible location, Ayutthaya quickly became powerful, politically, and economically. Ayutthaya's name is derived from Ayodhya, an Indian holy city. The first ruler of the Kingdom of Ayutthaya, King Uthong (r. 1351–1369), made two important contributions to Thai history: the establishment and promotion of Theravada Buddhism as the official religion to differentiate his kingdom from the neighbouring Hindu kingdom of Angkor and the compilation of the Dharmaśāstra, a legal code based on Hindu sources and traditional Thai custom. The Dharmaśāstra remained a tool of Thai law until late in the 19th century. In 1511 Duke Afonso de Albuquerque dispatched Duarte Fernandes as an envoy to the Ayutthaya Kingdom, known then to Europeans as the "Kingdom of Siam". This contact with the West during the 16th century led to a period of economic growth as lucrative trade routes were established. Ayutthaya became one of the most prosperous cities in Southeast Asia. According to George Modelski, Ayutthaya is estimated to have been