It's said that lightening, attracted to gold holding his Buddha medallions, killed Phaya Mengrai, in 1317 AD at the central market of ChiangMai. Half a century later, the Mongol Dynasty ended and Sukhotai was losing power. Phaya Chai Songkram managed affairs in Chiang Mai for four months after his father's death, going to rule Chiang Rai after giving the Chiang Mai throne to his son and next in line, Thao SaenPu. Second son Thao NamThuam was sent to rule Fang, and 3rd son Pho Thao Ngua was given Chiang Khong. Chaya Songkram's younger brother, Chao Khun Khrua, who'd been exiled to Muang Nai by Mengrai, scared Thao SaenPu out of ChiangMai in 1321. So, from Chiang Rai, Phaya Chai Songkram ordered NamThuam to go seize Chao Khun Khrua. Khun Krua, drunk, proved unable to defend himself. NamThuam was given ChiangMai, but after two years was deemed disloyal and banished to Keng Tung (Kemarat), where, according to the Chronicles, he was provided with all comforts and ruled as king. SaenPu was restored to the Chiang Mai throne in 1324, but when ChaiSongkram died in 1327, ascended to the Chiang Rai throne and became Phaya SaenPu. His heir, Phaya KhamFu was given rule in Chiang Mai. Thus we see Chiang Rai superceding Chiang Mai as top royal seat, regardless of Mengrai's intentions!
SaenPu annexed Payao to Lanna, then built Chiang Saen at the site of ancient Yonok Nagaburi, from after 1320 into the 1330s, and re-named it after himself. Chiang Saen, with gold and silver works, iron forging, drum smiths, distilleries, sweets manufacture and lacquorwork, became the royal center when SaenPu took his court there, where he stayed until death. Phaya KhamFu's son, Phaya PaYu, returned the center of administration to Chiang Mai.
Phaya KeuNa, either 7th or 8th King of all Lanna, introduced the Langka Wong creed, and brought on the Golden Age of Lanna (1367-1525). Forest monks brought Sri Lankan texts of a relatively uncorrupted, egalitarian form of Sinhalese Theravada (Hinnayana) Buddhism. This had many positive effects throughout Lanna society, which became as civilized, advanced and comfortable as any place on Earth, and a center of Buddhist learning.
Pressure from Chinese (and Mongols) to the north, somewhat ameliorated through a buffer provided by the fierce Wa tribe's intimidating headhunting, eased after Kublai Khan's death. In 1367 the Mongols lost China to the Mings. Phaya KeuNa's son, Phaya Saen Muang Ma, feeling his back safe, overconfidently invaded Sukhotai. He barely escaped with his life. Sukhotai briefly fell to Ayudhaya in 1379. In 1393, Mongol rule over the middle Mekong Valley (LanXang, centered on LuangPrabang) ended.
The rulers of Lanna, with one exception, were staunch Buddhists. In the early 15th century, the reigning monarch renounced Buddhist Doctrine. He expropriated the monasteries, transferring his worship to the spirits and his support to sorcerers. This was Sam FangKaen (1401-42 AD), who reverted to animism while fighting Chinese. His older brother had ruled at ChiangRai, and tried to take ChiangMai, but failing, fled to Sukhotai. The king of Sukhotai led men against ChiangMai; Lawa and Kachin people came to its defense. Before retreating home, the Sukhotai army rested at ChiangRai, where their king noticed the shapes of two mountains. One looked to him like an elephant, the other like a mouse, and he'd reported to have proclaimed, "Anyone living here in this city will never be well-endowed with possessions."
Prince Hulumpha of Nongseh (Yunnan, leader of the Ho or Haw, possibly related to Islamic Chinese southern Silk Road tenders and traders, which might establish some slight T'ai connection to Mount Altai, as early historians for the Chakris attempted to proclaim) demanded resumption of tribute, ceased under KeuNa (at the time of the Ming takeover, or, according to Manich Jumsai, 100 years earlier when Nongseh was annexed by Chinese under the Mongols). Sam FangKaen, king for a year in 1402 but only 14 years old, organized 22,000 men from Fang, ChiangRai, Chiang Khong, Toeng and Payao to battle the Haw at ChiangSaen. Using first covered trenches with sharp bamboo stakes pointed up inside, then red-hot "sand and pebbles hurled with iron ladles down their necklines" (ChiangMai Chronicle Chapter 4), Lanna persevered. The Haw came back 3 years later though. Astrologers and scholars advised that fate dictated "we should lose the city." But FangKaen sacrificed to old guardian spirits, going from place to place, especially ChiangRai and ChiangSaen. Lightening struck the Haw headquarters, killing their chief and many others. Survivors were pushed back to the Lue homeland in Sipsongpanna, and, deciding Lanna had enormous, mysterious power, they voiced resolve never to attack it again! Did Sam Fang Kaen's reversion to animism have anything to do with the lightening strike? Did it lessen trade from the Southern Silk Road? Possibly so.
In 1421 a lightening bolt hit the Chinese Emperor's Pleasure Palace in the Forbidden City, killed his favorite concubine, and called into question his Mandate of Heaven. It seems a direct result that Ming China then became isolationist - policies had to be revised to placate the Heavens. Southern coastal Chinese had to resent this isolationism, and sought a port independent of Beijing authority. They found it in Ayudhaya. Remnants of Khom (ancient Brahman rulers of the Khmer) and Mon royalty, and a minor lord of the house of Mengrai (Utong, who became Ramathipodi and ruled 'til 1369), had started this port city with the help of Chinese junk captains who cut through mangroves to reach it (the sea came further north then, less sediment having been deposited by the ChaoPraya River). Utong most likely brought with him Yunnanese from his area of Lanna to act as counterbalance to what we might see as Cantonese merchants. The great armada of Jung Hu visited, and Supanburi, Lopburi and Sukhotai all became subservient to the great new port, Ayudhaya.
The next king of all Lanna, Phaya Tilokarat (ruled 1442 to 1487) seized the throne from his father Sam FangKaen, and brought Lanna power to its peak. An 8th Buddhist council (Sangaeyana, usually referred to as a World Council) was held in Chiang Mai's Wat Jed Yot in 1477. His attentions to purification of the Buddhist cannons hardly tamed King Tilok's spirit, though: between 1450 and 1457 he fought the Lue and Lawa, first near KengTung (Shan State) then near ChiangRung (Yunnan). He conquered Nan, Phrae and eleven of the Shan States. Lanna was at its largest, stretching from the Salween to the Mekong, from KengTung and ChiangRung in the north to Lamphun (and some say Sukhotai) in the south. At Nan, Lanna men under Tilokarat fought Vietnamese.
The nephew who succeeded him, Phaya Yot ChiangRai, improved relations with the Haw, but failed with his own ministers, who elevated a young son, Phaya Muang Kaeo, to replace him. Muang Kaeo kept peace while strengthening the scholarly Singhalese order of Buddhism (Langka Wong) introduced by Phaya KeuNa over a century earlier. But even today, strong animist tendencies remain.
Lanna's area of influence and trade now extended from eastern Tibet through western Sichuan to lower Yunnan, and Lanna was important in the valleys of the Red River area of northern Vietnam, as in the northern Irrawaddy. Lanna had three distinct areas: first, the northern, draining into the Mekong through the Mae Nam Kok, second, the Ping and Nan, draining the central area, through parallel, unconnected valleys, and third, the western high jungles of the Pai and Yuan rivers and Mae Hong Son and Mae Sariang basins.
The present concept of the nation-state not yet having taken hold, it's best to view Lanna not as a country, but as a network of aligned principalities (Chiang Mai, Chiang Rai, Chiang Saen, Lamphun, Lampang, Phrae and Nan) with smaller dependent chiefdoms (Phayao, Mae Cham, Mae Sariang, Mae Hong Son, Fang and others) surrounding. Tribal groups relocated between hills, but there was a clear pattern of dominance and submission. That pattern had little rigid stability - tribal peoples related to modern Karen, for instance, were never amalgamated into it. Families of leading war-chiefs cemented alliances by marriage to heirs of adjacent principalities (throughout the Shan States, Lan Xang, Sipsongpanna, and south to Pitsanulok, Supanburi, Lopburi and Ayudhaya); while intermittent feuding and warfare remained the norm. Caravan tracks through the forests and jungles had to be maintained, as also terraced rice paddies with channels for irrigation and huge water-lifting wheels. Architects and craftsmen embellished religious buildings wherein important writing was done. Special health-care techniques were developed, and religious ideas considered. Lanna flourished with trade passing from from the Southern Silk Road to the harbors of Martaban and Molmein (but not to the Chao Phraya river valley area). Cargo included foodstuffs (dried fish, coconut, walnuts and other nuts, honey and sugar, oils, pepper, cloves, ginger, benjamin and other gums, tea and salt), luxury items like betel, opium, tobacco (after 1500 anyway, and maybe over half a century earlier), ivory, gemstones, felt, velvet, sandalwood and other aromatic substances, and dry goods (jute rope, yarn and thread, silk, cotton, dyes, hides, furs, guns, gunpowder, soap, matches, gum resins, teak, lacquer, porcelain, knives, beeswax, sealing wax, baskets, straw hats, clay jugs, iron bars and dishes, and brass and bronze pots). Pewter, gold, silver, tin, copper, lead, iron, saltpeter, sulfur, loadstones, styrax, benzoin, Chinese medicines, horses, oxen, sappan wood, antler, tusks, rhino horn, and talismans were also traded, carried by up to a hundred or more pack animals, often by Haw people. Lanna princes controlled trade: taxing Yunnanese, Shan and Burmese merchants for every load, if not every transaction.
Consolidation by Somdet Phra Nakarindarachathirat of Suvannaphum and Sukhotai, at the beginning of the 15th century, made Ayudhaya seat of a vast empire. State-controlled trade with China and India prospered. The name Siam gained prominence, use originating in other countries, especially the Burma of Ava and Pegu, though use extended through China, Cambodia and Champa, to refer to the important place of business in the Chao Phraya valley.
In 1492, the white crystal Buddha image at Wat Chiang Man, Chiang Mai, was smuggled to Ayudhaya. This image, Pra Setangamani, had been a personal protective icon of Paw Khun Mengrai after he took Haripunchai. Lanna's king in 1492, Phra Yod Chiengrai, sent an army from Chiang Mai to invade Ayudhaya and retrieve the image. Return invasions from Ayudhaya by King Rama Tibodi II, in 1508 and 1510, failed.
Portuguese merchants began using the name 'Siam' for Ayudhaya; and Chiang Mai, among other names, for Lanna. Lanna language was referred to as Lao. After the Burmese conquered Ayudhaya in 1569, the Mon/Khom influence important to the south lessened comfortably.