Following the Sack of Ayutthaya and the collapse of the Ayutthaya Kingdom during the Burmese–Siamese War (1765–1767), a power vacuum left Siam divided into 5 separate states—Phimai, Phitsanulok, Sawangburi, Nakhon Si Thammarat, and Thonburi. The state of Thonburi, led by Taksin, would ultimately prevail, subjugating its rivals to successfully reunify Siam by 1771.