Initially there was an attempt of an alliance between Johor and Jambi with a promised marriage between the heir Raja Muda and daughter of the Pengeran of Jambi. However, the Raja Muda married instead the daughter of the Laksamana, who was concerned about the dilution of power from such an alliance and so offered his own daughter for marriage.[5] The alliance broke down, and between 1666-1679, a long war erupted and Jambi successfully sacked the Johor capital in Batu Sawar in 1673. Sultan Abdul Jalil Shah III fled to Pahang and made it as his administration centre for four years before he died in Kuala Pahang in 1677.