In 1419, after the death of Sai Lue Thai, his sons Phaya Ram and Phaya Ban Mueang fought for the throne. Intharacha of Ayutthaya Kingdom intervened and further divided the kingdom between the two. Ban Mueang was installed as a vassal king, owing allegiance to Ayutthaya. His residence was in Phitsanulok, though the kingdom was still referred to as "Sukhothai".[1] In 1430, he moved his residence back to the old capital.[2] When Maha Thammaracha IV died in 1438, King Borommaracha II of Ayutthaya installed his son Ramesuan (the future king Borommatrailokkanat of Ayutthaya) as viceroy of Sukhothai, thus marking the end of Sukhothai as a separate kingdom.[3]