ThePemberontakan Trunajaya rebellionmulai beganpada intahun 1674 asketika pasukan Trunajaya'sforcesmelakukan conductedpenyerbuan raidsterhadap againstkota-kota thedi citiesbawah underkekuasaan Mataram control.{{sfn|Pigeaud|1976|p=69}} Kajoran joined the rebellion since at least 1676 after Trunajaya's [[Battle of Gegodog|victory at Gegodog]] in October.{{sfn|Pigeaud|1976|p=71}} His knowledge of the internal Mataram affairs, as well as his reputation as a religious leader, provided support to Trunajaya and his Madurese warlords who were foreign to central Java.{{sfn|Pigeaud|1976|p=86}}{{sfn|Kemper|2014|loc=p. 69, note 287}}