[3] The Kingdom of Mengwi came to an end after being defeated by its own kin, Badung, and its allies in 1891.
Mengwi regained its independence after the death of Badung's king, I Gusti Ngurah Made Pemecutan.
Badung won the war with the assistance of Muslims from Serangan and Kepaon in Pemogan [id].
[4] During the battle, the King of Badung, Pamecutan III, was assisted by Raden Sastraningrat and his troops from Java.
Pura Taman Ayun is a place of rest and worship for the family of the Mengwi Kingdom.
During the period of the Kingdom of Mengwi, the temple also served as a source of irrigation for the farmers' fields.