Before becoming Thailand's capital in 1782, Bang Makok or 'Place of Olives' (now Bangkok) was an outlying district of Thonburi, a town founded as a trading post in the mid-16th century. Due to its proximity to Siam's capital, Ayuthaya, the town also developed military significance. In the 18th century a fortress was built on the banks of the Chao Phraya and a great iron chain hung across the river to block unwelcome arrivals.
In 1782, King Rama I, the founder of the long-running Chakri dynasty, moved the capital to Bangkok on the other side of the river, believing it was an easier location to defend. Using thousands of Khmer prisoners of war, city walls were built, the canal system was expanded, and new temples were erected by artisans from Ayuthaya. When the construction of the new capital was finished in 1785, it was given a new name: a tongue-twister comprising 164 letters which referred modestly to divine gems, unconquerable lands and divine shelters. The name was mercifully shortened to Krung Thep ('City of Angels'), but the city is still known by its old Bangkok moniker to most of the outside world.
The first half of the 19th century in Bangkok saw a frenzy of temple building under the rule of Rama III, while the definitive moment of his successor's turn at the throne was the construction of the city's first road alongside the river in 1861. More roads were soon added and, well before the turn of the century, horse-drawn carriages and rickshaws had replaced watercraft as the favoured mode of urban travel.