the fleet. However, the Siamese forces were defeated in the naval Battle of Vàm Nao and retreated. The Siamese defeat confirmed Vietnamese domination over Cambodia. Ming Mạng annexed Cambodia into Trấn Tây Province with Trương Minh Giảng as the governor. After the death of Ang Chan, Minh Mạng also installed Ang Mey as puppet queen regnant of Cambodia. In 1840, the Cambodians arose in general rebellion against Vietnamese domination. Bodindecha marched Siamese armies to attack Pursat and Kampong Svay in 1841. The new Vietnamese Emperor Thiệu Trị ordered the Vietnamese to retreat and the Siamese took over Cambodia. The war resumed in 1845 when Emperor Thiệu Trị sent Nguyễn Tri Phương to successfully take Phnom Penh and lay siege on Siamese-held Oudong. After months of siege, Siam and Vietnam negotiated for peace with Prince Ang Duong, who would recognize both Siamese and Vietnamese suzerainty, installed as the new King of Cambodia in 1848. Malay Peninsula and Contacts with the West After the Fall of Ayutthaya in 1767, the Northern Malay states that used to pay bunga mas tributes to Siam were freed temporarily from Siamese domination. In 1786, after expelling Burmese invaders from Southern Siam, Prince Sura Singhanat declared that Northern Malay sultanates should resume tributary obligations as it had used to be during the Ayutthaya times. Kedah and Terengganu resolved to send tributes but Pattani refused. The Siamese prince then sent armies to sack Pattani in 1786, bringing Pattani into Siamese rule. Malay states of Pattani, Kedah and Terengganu (including Kelantan, which was then part of Terengganu) came under Siamese suzerainty as tributary states. Pattani rebelled in 1789–1791 and 1808. Siam ended up dividing Pattani into seven distinct townships to rule. Kelantan was separated from Terengganu in 1814. In 1821, Sultan Ahmad Tajuddin Halim Shah (known in Thai sources as Tuanku Pangeran) of Kedah was found forging alliance with Burma – Siam's archnemesis. Siamese forces under Phraya Nakhon Noi the "Raja of Ligor" invaded and captured Kedah. The Kedah sultan took refuge in British-held Penang. A son of Nakhon Noi was installed as the governor of Kedah. The Kedah sultanate ceased to exist for a time being. Since the fifteenth century, the Siamese royal court had retained monopoly on foreign trades through the Phra Khlang Sinkha () or Royal Warehouse. Foreign merchants had to present their ships and goods at Phra Khlang Sinkha for tariffs to be levied and