The Grand Palace has an area of 218,400 sq. metres and is surrounded by walls built in 1782. The length of the four walls is 1,900 metres. Within these walls are situated government offices and the Chapel Royal of the Emerald Buddha besides the royal residences. When Siam restored law and order after the fall of Ayutthaya the monarch lived in Thonburi on the west side of the river. Rama I, on ascending the throne, moved the centre of administration to this side of the Chao Phraya; and, after erecting public monuments such as fortifications and monasteries, built a palace to serve not only as his residence but also his offices–the various ministries, only one of which remains in the palace walls. This palace came to be known as the Grand Palace, in which the earliest edifices contemporary with the foundation of Bangkok were the two groups of residences named the Dusit Maha Prasat and the Phra Maha Monthian.