In 1674 he led a revolt against Amangkurat I and Amangkurat II of Mataram.[2] He was supported by itinerant fighters from Makassar led by Kraeng Galesong.[2] The Trunajaya rebellion moved swiftly and strong, and captured the Mataram court at Plered in mid-1677.