Near the border of Laos lies the city of Nan, a provincial capital founded in 1272. According to local legend, Lord Buddha, passing through Nan Valley, spotted an auspicious site for a temple to be built. By the late 13th century Nan was brought into Sukhothai's fold, but it maintained a fairly independent status until the last few decades.