Tun Habib was also reportedly well-loved and respected among his subjects and often worked closely with his ministers (Orang Kaya). Shortly after he regained power, Tun Habib relocated the Johor Empire's capital to Kota Tinggi.[1] He also took charge of state affairs by proxy in Terengganu, at that time a sparsely populated state.[14] Sultan Mahmud was given more opportunities to participate in state roles under Tun Habib, although it was the latter who wielded the actual control over the Sultanate's affairs.[15] Tun Habib later died in Padang Saujana, Kota Tinggi in 1697, where he was buried.[16] His oldest son, Abdul Jalil, succeeded him as the 20th Bendahara of Johor but usurped the throne from Sultan Mahmud Shah II just two years later in 1699 and took the title Sultan Abdul Jalil IV.[5] His 5th son, Zainal Abidin, who was living in Pattani, came down to Terengganu and became its first Sultan.[17]