Maha Thammaracha (king of Ayutthaya)

Maha Thammaracha (มหาธรรมราชา,, , မဟာဓမ္မရာဇာ ), Maha Thammarachathirat (มหาธรรมราชาธิราช, ), or Sanphet I (สรรเพชญ์ที่ ๑), formerly known as Khun Phirenthorathep (Old ขุนพิเรนเทพ; Modern ขุนพิเรนทรเทพ), was a king of Ayutthaya Kingdom from the Sukhothai dynasty, ruling from 1569 to 1590. As a powerful Sukhothai noble, Phirenthorathep gradually rose to power. After playing many political turns, he was eventually crowned as the King of Siam.

A Sukhothai noble
Though the Kingdom of Sukhothai had come under personal union with Ayutthaya since 1448, the royal clan of Sukhothai still held power in their base Phitsanulok and constitutes as one of four political clans of 16th century Ayutthaya (Supannabhum, Uthong, Sukhothai, and Sri Thamnakorn). Chairacha, however, tried to reduce the power of Sukhothai nobles. He ceased to appoint the Uparaja the King of Sukhothai and called the Sukhothai nobles to Ayutthaya to dissolve their base of power at Phitsanulok.

Khun Phirenthorathep was one of the Sukhothai nobles brought to the court of Ayutthaya by Chairacha. In 1548, the kingdom fell under the governance of Worawongsathirat and Si Suda Chan of the Uthong clan. The Uthong clan rose to power at the expense of other clans. Khun Phirenthorathep then sought alliance with Sri Thamnakorn clan led by Khun Inthrawongse and staged a coup against Worawongsathirat and Si Suda Chan in 1548, restoring the throne to Suphannaphum dynasty, namely King Maha Chakkraphat.

In gratitude for putting him on the throne, Maha Chakkraphat made Khun Phirenthorathep ruler of Phitsanulok and conferred him the semiroyal title of Maha Thammaracha. This was in line with the reigning name of Sukhothai kings in the 14th century. Maha Thammaracha enjoyed a great power and may be referred to as a viceroy of the northern provinces. He married Maha Chakkraphat's daughter, Sawatdirat (later Queen Wisutkasat).

Viceroy of Phitsanulok
In 1548, King Tabinshwehti of Pegu led Burmese forces and invaded Ayutthaya in the Burmese–Siamese War of 1547–49. The Siamese managed to force a retreat upon the Burmese. However, the Siamese armies under Prince Ramesuan the Uparaja and Maha Thammarachathirat were ambushed and the two captured. They were released when Maha Chakkrapat paid the ransom of two male war elephants.

In 1563, Tabinshwehti's successor, Bayinnaung, led the massive Burmese armies to invade Siam. He laid siege on Phitsanulok. Maha Thammarachathirat offered "stout resistance", but surrendered and submitted after all food was gone and a smallpox epidemic spread. He submitted to Bayinnaung on 2 January 1564.

Maha Thammarachathirat had to send his sons Naresuan and Ekathotsarot to Pegu as a captives. With his son in Burmese captivity, Maha Thammarachathirat was forced to ally himself with Bayinnaung.

Mahinthrathirat—son of Maha Chakkraphat—then sought alliance with King Setthathirat of Lan Xang to fight Bayinnaung and Maha Thammarachathirat. In 1566, during Maha Thammarachathirat's absence from Phitsanulok to Pegu, Mahinthrathirat brought his sister Queen Wisutkasat and her sons and daughters to Ayutthaya. Maha Thammarachathirat sought help from Bayinnaung.

In 1568, Bayinnaung marched large Burmese armies to Ayutthaya with support from Maha Thammarachathirat. Ayutthaya finally fell in 1569 and Maha Thammarachathirat was installed as King of Ayutthaya. Bayinnaung bestowed him the reigning name Sanphet I. The date of appointment was 29 September 1569.

King of Ayutthaya
Maha Thammarachathirat asked Bayinnaung to return his sons Naresuan and Ekathotsarot to Ayutthaya in exchange for his daughter Suphankanlaya as Bayinnaung's secondary wife in 1571. Maha Thammarachathirat made Naresuan the King of Phitsanulok and Uparaja in 1569. Ayutthaya kingdom under Maha Thammarachathirat was tributary to Burma.

Cambodian invasions
In 1570, Barom Reachea III the King of Lovek marched his Cambodian armies to Ayutthaya and laid siege on the city but failed. In 1574, under the request from Pegu, Maha Thammaracha led the Siamese armies to subjugate Vientiane. The Cambodians took this opportunity to invade Siam but was also repelled.

In 1578, the Cambodians invaded Khorat and proceeded further to Saraburi. Naresuan sent Siamese armies to ambush the Cambodians at Chaibadan, halting the invaders from reaching Ayutthaya.

Break from Pegu
In 1581, Bayinnaung died, succeeded by his son Nanda Bayin. In 1583, the Lord of Ava and the Shans staged a rebellion against Pegu. Nanda Bayin then requested for troops from Ayutthaya. The Siamese armies went slowly to Ava under leadership of Naresuan. Naresuan then renounced loyalty to Pegu in 1584.

In 1584, Nanda Bayin himself led the Peguan armies into Siam but was defeated by Naresuan. For many years the Burmese armies surged into Ayutthaya but was repelled. Maha Thammarachathirat died c. 30 June 1590. He was succeeded by Naresuan.