In 1511, the capital of Melaka was attacked and conquered by the Portuguese Empire, prompting a retreat of Sultan Mahmud's court to Pahang by the Penarikan route.[29] There, he was welcomed by Abdul Jamil. The deposed ruler stayed a year in the country during which time he married one of his daughters, whose mother was a Kelantanese princess, to Sultan Mansur. Between 1511 and 1512, while Mahmud was in Pahang, Sultan Abdul Jamil died and was buried at Pekan in the graveyard Ziarat Raja Raden.