Nan's history, development, and architecture were greatly influenced by various neighboring kingdoms, in particular Sukhothai, which played important political and religious roles in shaping the development of Nan. Over the centuries however, Nan alternated between being an independent principality under the control of Lan Na, Sukhothai, Burma and Siam in that order. In 1558, the town was conquered and depopulated by the Burmese. By the late 18th century Nan forged an alliance with the new Bangkok centered Rattakosin Kingdom and existed as a semi-autonomous kingdom with a line of monarchs that ruled from 1786 until 1931. Today, Nan is still the home of numerous Thai Lue and other hill tribes who retain many of their fascinating customs and traditions.