Also referred to as 'the Thai capital of the north', Chiang Mai is Thailand's second largest city. Chiang Mai was first founded in 1296, and due to a prominent location on the River Ping and close to the Burmese border, it soon became the capital of the Lanna kingdom. As the city continued to develop and increase in importance, many defensive walls and other structures were built, along with the magnificent temples that are dotted throughout the Old Town today. In time relations with the Burmese became strained, and with an increasing number of attacks Chiang Mai lost its status as a capital, and began to diminish in importance. After the end of the Lanna Kingdom, in 1774 the city formally became part of Siam, and once again the city began to expand.