In 1615, the Acehnese under Iskandar Muda invaded Pahang, forcing Alauddin Riayat Shah to retreat into the interiors. He nevertheless continued to exercise some ruling powers and faced several further onslaughts by the Acehnese in 1617,1635 and 1638 and from Johor in 1638. His reign in exile is considered officially ended after the installation of a distant relative, Raja Bujang to the Pahang throne in 1615.