section_path: History/Thonburi Kingdom (1767–1782)
section_name: Thonburi Kingdom (1767–1782)
paragraph_text: Thonburi Kingdom (1767–1782)
  
  The capital and many of its territories lay in chaos after the war. The former capital was occupied by the Burmese garrison army and five local leaders declared themselves overlords, including the lords of Sakwangburi, Phitsanulok, Pimai, Chanthaburi, and Nakhon Si Thammarat. Chao Tak, a capable military leader, proceeded to make himself a lord by right of conquest, beginning with the legendary sack of Chanthaburi. Based at Chanthaburi, Chao Tak raised troops and resources, and sent a fleet up the Chao Phraya to take the fort of Thonburi. In the same year, Chao Tak was able to retake Ayutthaya from the Burmese only seven months after the fall of the city.
  
  Chao Tak then crowned himself as Taksin and proclaimed Thonburi as temporary capital in the same year. He also quickly subdued the other warlords. His forces engaged in wars with Burma, Laos, and Cambodia, which successfully drove the Burmese out of Lan Na in 1775, captured Vientiane in 1778 and tried to install a pro-Thai king in Cambodia in the 1770s. In his final years there was a coup, caused supposedly by his "insanity", and eventually Taksin and his sons were executed by his longtime companion General Chao Phraya Chakri (the future Rama I). He was the first king of the ruling Chakri dynasty and founder of the Rattanakosin Kingdom on 6 April 1782.