After Prince Soi's death, the governor of Muong Terng, who remained loyal to Soi even after his death, secretly wrote a letter to Borommarachathirat II urging him to attack Lan Na. The governor's treachery was uncovered and he was put to death; nevertheless, an Ayutthayan army was already marching towards Chiang Mai from the south. Tilokaraj appointed Muen Loknakorn as his commander-in-chief and tasked him to stop the invading Ayutthayan army. The Lan Na troops took positions opposite an Ayutthayan encampment and sent out three soldiers to infiltrate the invaders under the cover of darkness. The soldiers untied the Ayutthayan
war elephants and cut their tails, sending them into a frenzy; chaos ensued. The Ayutthayans were unable to offer organised resistance to a Lan Na assault on the camp and were forced to retreat. Tilokaraj captured the cities of
Phrae and
Muong Nan, after successfully employing artillery. Borommarachathirat II failed to capture Chiang Mai in 1442 and was repulsed a second time in 1448. In 1448,
Borommatrailokkanat succeeded Borommarachathirat II as king of Ayutthaya. He soon created the most advanced military administration in Southeast Asia. In 1451,
Sawankhalok broke away from Ayutthaya and joined Lan Na, and thus the conflict between the two kingdoms broke out anew. Lan Na forces under Muen Harn Nakorn besieged
Chaliang, but a late night counterattack by the defenders repelled the invaders. Ayutthaya captured Chiang Mai in 1452, but was compelled to withdraw after Lan Na received help from the
Lao Kingdom of
Lan Xang. In 1455, Borommatrailokkanat tried to conquer the Malay state of
Malacca, but was defeated. In 1457, hostilities between Lan Na and Ayutthaya resumed. In 1459, Lan Na captured Sawankhalok, which had in the meantime rejoined Ayutthaya. A year later, Ayutthaya reconquered
Phrae Province while Lan Na was engaged in conflict with the Shan states. Shortly afterwards, Lan Na unsuccessfully attacked Sawangkaburi. An Ayutthayan army under Prince Intharacha clashed with Lan Na on the Doi Ba Hill on the outskirts of Chiang Mai; both sides suffered heavy casualties, none taking the upper hand. Prince Intharacha died shortly after the battle after being struck by a bullet. Relative peace ensued after Borommatrailokkanat was ordained as a Buddhist monk with the assistance of Lan Na priests. In 1474, Ayutthaya attacked Chienjuen and killed the governor of the city. Lan Na then retook the city, putting an end to the conflict. Despite limited territorial gains, Lan Na was weakened by a combination of internal power struggles and casualties suffered during the conflict. ==Aftermath==