The Old Pahang Sultanate centred in modern-day Pekan was established in the 15th century. At the height of its influence, the Sultanate was an important power in Southeast Asian history and controlled the entire Pahang basin, bordering the Pattani Sultanate and the Johor Sultanate. The sultanate has its origins as a vassal to the Malaccan Sultanate. Its first Sultan was a Malaccan prince, Muhammad Shah, himself the grandson of Dewa Sura, the last pre-Malaccan ruler of Pahang. Over the years, Pahang grew independent from Malaccan control and at one point even established itself as a rival state to Malacca until the latter's demise in 1511. In 1528, when the last Malaccan Sultan died, Pahang joined forces with his successor, Alauddin Riayat Shah II who established himself in Johor to expel the Portuguese from the Malay Peninsula. Two attempts were made in 1547 at Muar and in 1551 at Portuguese Malacca. However, in the face of superior Portuguese arms and vessels, the Pahang and Johor forces were forced to retreat on both occasions.