By that time, Banten enjoyed a favourable relation with Cirebon. On the other hand, Cirebon relations with their suzerain, Mataram, were strained. The tension culminated with the execution of Cirebon King Panembahan Girilaya in Plered, while the Cirebon princes were taken as the hostage in Mataram. Prince Wangsakerta of Cirebon went to Banten to seek Sultan Ageng Tirtayasa's help in freeing his brothers. Tirtayasa agreed to assist Cirebon and saw it as an opportunity to raise Banten's influence upon Cirebon. Using the opportunity of the Trunojoyo rebellion against Mataram, Sultan Ageng Tirtayasa secretly supported the revolt and managed to weaken Mataram and save the two Cirebon princes.