The landscape of Mueang Fang looked like the seed of a Fang tree (Caesalalpinia sappan). Thus the town was named after the tree.
According to the Yonok chronicle, Mueang Fang was built in 641 by King Lawa Changkarat. Around 1268, King Mengrai the Great ruled Fang before building Wiang Kumkam and Chiang Mai of the Lanna Kingdom. It seems that Mengrai used Mueang Fang for the base to invade Hariphunchai (Lamphun) in 1281.
*Source: Wikipedia
From Fang, the Thais embarked on their gradual capture of the Mon Kingdom. Fang later developed into an important trading center, and for a long time its people held out against conquest by the Burmese, only capitulating in 1732 after a lengthy siege (Chiang Mai had already fallen in 1556). The Thais managed to wrest the town from its captors in the late 18th century, and since the end of the 19th century, Fang has been part of the Province of Chiang Mai, and hence the Kingdom of Thailand.
The oil that was discovered around Fang in the 1950s proved to be of little value, and the dream of “black gold” vanished as swiftly as it had arrived.
Fang was once an important part of the Lanna Kingdom, a major trading center and a place of strategic significance.
Its remains a meeting place for the hill tribe peoples from the surrounding mountains. Akha, Lisu and Meo come into Fang to sell their market produce. The city was once a gateway to the notorious “Golden Triangle” where the bulk of the world’s opium was once grown for the heroin trade. For decades, this frontier region was guarded by former soldiers from Chiang Kai-shek’s Kuomintang (KMT)forces. They were allowed by the Thai government to settle here after their defeat by the Chinese Communists, and long and bloody exile in Myanmar (Burma).
Nearby Chai Prakan was founded approximately 900, and is therefore one of the earliest settlements in present-day Thailand.
In 1910 the Mueang Fang was made a subordinate of Chiang Rai, then named Mueang Fang district. In 1925 it was reassigned to Chiang Mai. 1938 it the word Mueang was cut off from the name, which was then reserved for the capital districts on the provinces.
*Source: Wikipedia