He stopped paying tributes to the Sultan even before Sultan Ibrahim Shah's death in 1685, and appointed filled the top ranks with his family members. Naturally, these appointments earned the wrath of many chiefs and top ministers, including Tun Habib himself. The Laksamana, unable to withhold the tremendous opposition from Tun Habib and his allies, fled to Terengganu in 1688 where he was shortly killed after that.[11] Shortly after Tun Abdul Jamil's expulsion, Tun Habib went over to Riau and took the young ruler, Sultan Mahmud Shah II back to Johor.[12]