The story behind the foundation of Bangkok was the Burmese invasions of Siam in both the 16th and 18th centuries, capturing Chiang Mai and destroying Ayuthaya. The Thais expelled the Burmese and moved their capital to Thonburi. In 1782, the current Chakri dynasty was founded by King Rama I and the capital was moved across the river to Bangkok.