The ascendancy of a Bendahara into a royalty began in the late 17th century, when the last ruler of Johor from Melaka dynasty, Mahmud Shah II died without a male heir. Tun Abdul Jalil, the Bendahara of Johor, became the next Sultan of Johor, assuming the title Abdul Jalil Shah IV. During his reign, the eastern state of Pahang was established as a special province of the Bendahara family and ruled directly by the successive Bendaharas of the empire.