Tun Perak was then appointed as bendahara in 1456 after he upset the Siamese attack against Malacca. He stopped another Siamese invasion in 1456 as well. Tun Perak was also instrumental in colonising Pahang, Terengganu, Johor, Riau, Lingga, Bengkalis, Karimon, Rokan, Siak, Kampar, Jambi, Inderagiri and Aru.