He had considerable political power as a crown prince, and from the 1650s the court was divided into factions in support of his father Ageng and him.
Haji's faction gained the upper hand in May 1680, just as Ageng had Batavia surrounded and was declaring war on the Dutch.
His position was weak, however, because he lacked the support of the Muslim elite, who remained loyal to his father, and who resented his overtures to the Dutch.
This constituted nearly all independent foreign policy of the sultanate, and the trade restriction would undermine the basis of their prosperity, but as Haji's position in Banten grew desperate, he accepted the agreement in 1682.
By the time a VOC force led by François Tack and Isaac de Saint-Martin came to help, Haji was besieged in his palace by his father's supporters.