After a few years
Batubara fell away from the sultan. Jamal ul-Alam sent troops to quell the uprising but failed. According to a story, the chiefs of Batubara feigned submission and sent poisoned young coconuts to the sultan who drank the juice without suspicion. He fell ill and immediately withdrew from the campaign, soon followed by his armada. The rebels now fortified Batubara against possible further attacks. One chronicle alleges that Jamal ul-Alam's popularity sank since he used
African retainers who performed much mischief in Aceh. Two years after the defection of Batubara the sultan visited the XXII Mukims, one of the three
sagis (regions) in which Aceh was divided. The secret purpose was to imprison Muda Setia, the
panglima (headman) of the
sagi whom the sultan disliked. The plans leaked out, however; Muda Setia fled and collected substantial troops to withstand Jamal ul-Alam. A battle was fought which ended with the complete defeat of the sultan's troops. Jamal ul-Alam had to seek refuge in a fortress and discussed with his counselors what to do. One of them, Panglima Maharaja, advised him to leave for a safer part of Aceh and employ the loyal
Buginese Maharaja Lela as commander in the fort until order had been restored. The sultan heeded the advice and fled to
Pidie in November 1726. ==After abdication==