When the Sultanate of Malacca empire fell to Portugal in 1511, Sultan Mahmud Syah I retreated to Kampar, Sumatra, and died there in 1528. He left behind two princes named Sultan Alauddin Riayat Shah II and Sultan Muzaffar Syah. The former went on to establish the Sultanate of Johor.