Tun Ali is the second son of the 21st Bendahara of Johor Tun Koris who succeeded on the death of his father and installed by Sultan Mahmud Shah III in 1806. He was about 25 years of age at the time of his accession.[2]