Nan for centuries was a separate, autonomous kingdom with few relationships with the outside world. There is evidence of prehistoric habitation, but it wasn't until several small "mueang" united to form "Nanthaburi" on the Nan River in the mid-14th century, contemporaneously with the creation of Luang Prabang and the Lan Xang (Million Elephants) kingdom in Laos, that the city became notable. Associated with the Sukhothai Kingdom, the "mueang" took the title "Wara Nakhon" and played a significant part in the development of early Thai nationalism.