However, he was replaced a year later by a relative, Raja Bujang who was installed with the support of the Portuguese following a pact between the Portuguese and the Sultan of Johor. Raja Bujang's appointment was not accepted by Aceh, which was then at war with the Portuguese. Aceh launched savage attacks on Pahang which, in 1617 forced Raja Bujang to flee to Lingga.[49]