General Chakri succeeded him in 1782 as Rama I, the first king of the Chakri dynasty. In the same year he founded the new capital city across the Chao Phraya river in an area known as Rattanakosin Island. (While settlements on both banks were commonly called Bangkok, both the Burney Treaty of 1826 and the Roberts Treaty of 1833 refer to the capital as the City of Sia-Yut'hia.[24]) In the 1790s, Burma was defeated and driven out of Siam, as it was then called. Lanna also became free of Burmese occupation, but was reduced to the Kingdom of Chiangmai: the king of the new dynasty was installed as a tributary ruler of the Chakri monarch.
Rama I restored most of the social and political system of the Ayutthaya kingdom, promulgating new law codes, reinstating court ceremonies[25] and imposing discipline on the Buddhist monkhood. His government was carried out by six great ministries (Krom) headed by royal princes. Four of these administered particular territories: the Kalahom the south; the Mahatthai the north and east; the Phrakhlang the area immediately south of the capital; and the Krom Mueang, the area around Bangkok. The other two were the ministry of lands (Krom Na) and the ministry of the royal court (Krom Wang). The army was controlled by the King's deputy and brother, the Uparat.
The heirs of Rama I became increasingly concerned with the threat of European colonialism after British victories in neighbouring Burma in 1826. The first Thai recognition of Western power in the region was the Burney Treaty with the United Kingdom in 1826. In 1833, United States diplomatist Edmund Roberts exchanged a treaty with Siam, updated in 1856, 1945 and 1949. Numerous treaties with foreign powers were signed during the reigns of King Mongkut (1804–1868), and his son King Chulalongkorn (1853–1910).