signed. Johor-Jambi war With the fall of Portuguese Malacca in 1641 and the decline of Aceh due to the growing power of the Dutch, Johor started to re-establish itself as a power along the Straits of Malacca during the reign of Sultan Abdul Jalil Shah III (1623–1677). Its influence extended to Pahang, Sungei Ujong, Malacca, Klang and the Riau Archipelago. During the triangular war, Jambi also emerged as a regional economic and political power in Sumatra. 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 Abdul Jamil who, concerned about the dilution of power from such an alliance, offered his own daughter for marriage instead. The alliance therefore broke down, and a 13-year war then ensued between Johor and the Sumatran state beginning in 1666. The war was disastrous for Johor as Johor's capital, Batu Sawar, was sacked by Jambi in 1673. The Sultan escaped to Pahang and died four years later. His successor, Sultan Ibrahim (1677–1685), then engaged the help of the Bugis in the fight to defeat Jambi. Johor would eventually prevail in 1679, but also ended in a weakened position as the Bugis refused to go home, and the Minangkabaus of Sumatra also started to assert their influence. After the sacking of Batu Sawar in 1673, the capital of Johor was frequently moved to avoid the threat of attack from Jambi. All through its history, the rulers of Johor had in fact constantly shifted their centre of power many times in their efforts to keep the sultanate together. Johor Lama (Kota Batu) was initially founded by Alauddin Riayat Shah II but was sacked by the Acehnese in 1564. It was then moved to Seluyut, later back to Johor Lama during the reign of Ali Jalla (1571–1597) which was sacked by the Portuguese in 1587, then to Batu Sawar, and Lingga (again sacked by the Portuguese). This is followed by a period with no fixed capital (places included Tanah Puteh and Makam Tauhid) during the reign of Sultan Abdul Jalil Shah III before he moved it to Batu Sawar in 1640. After Batu Sawar was sacked by Jambi, later capitals included Kota Tinggi, Riau, and Pancur. Golden Age In the 17th century with Malacca ceasing to be an