According to the Yonok chronicle,
Mueang Fang was built in 641 by King Lawa Changkarat. Later, King
Mengrai the Great ruled over Fang before building Wiang Kumkam and Chiang Mai as successive capitals of the
Lanna Kingdom, beginning in 1294. Prior to the new capitals, Mengrai had used Mueang Fang as a base to invade Hariphunchai. In 1910,
Mueang Fang was made part of
Chiang Rai province, and named Mueang Fang District. In 1925, it was reassigned to Chiang Mai Province. In 1938, the word
mueang was dropped from Fang's name, which was then reserved for capital districts of provinces. ==Etymology==