The Siamese launched their offensive in late 1841 and took Phnom Penh with ease, but had to withdraw in 1844 to Udong. After having suppressed internal rebellions, the Vietnamese counterattacked and placed Queen Ang Mey back to the throne in 1845. After reached a peace agreement with Siam, in June 1847 the Vietnamese court released all royal members of the Cambodian ruling family, transferred the government to the new independent Cambodian monarchy of king Ang Duong and withdrew their army from Cambodia, ending the Tây Thành Province.