Mahmud Shah of Malacca
Upon his father's premature death, he was installed at a very young age. The regent at that time was the prime minister (Bendahara in Malay) Tun Perak. During his initial years as a young adult, the sultan was known to be a ruthless monarch. The administration of the sultanate was in the hands of an able and wise Tun Perak. After the death of Tun Perak in 1498, he was succeeded by a new Prime Minister Tun Mutahir. The death of Tun Perak changed Sultan Mahmud into a more responsible ruler.
During Portuguese admiral Diogo Lopes de Sequeira's visit to Malacca from 1509–1510, the sultan planned to assassinate him. However, Sequeira learned of this plot and fled Malacca. When the famous Portuguese naval officer Afonso de Albuquerque received word, he decided to utilize this to embark upon his expeditions of conquest in Asia. Malacca was then subsequently attacked by the Portuguese in the Capture of Malacca (1511), during which the Sultan retreated to Muar, Johor and later further to Kampar, Sumatra and held a government there until his death in 1528.
He had several wives. Among the best known was Tun Teja. The sultan was also surrounded by able men and warriors such as Hang Tuah, Khoja Hassan and Hang Nadim. He had three sons; Sultan Ahmad Shah, Muzaffar I of Perak and Alauddin Riayat Shah II of Johor. Ahmad Shah succeeded Mahmud when Mahmud mistakenly killed the Bendahara Tun Mutahir and the Bendahara's family after Raja Mudaliar accused Mutahir of planning a rebellion. Ahmad Shah was deemed incompetent and was killed by Mahmud Shah himself in 1513 after a failed attempt to retake Malacca from the Portuguese. Mahmud Shah then reclaimed the throne, although by then the Malacca sultanate had been abolished, thus making him a pretender. Muzaffar went north to establish the Sultanate of Perak while Alauddin Riayat went on to found Sultanate of Johor.
Sultan Mahmud is associated with the Malay legend of Puteri Gunung Ledang which is about his failed courtship of a fairy princess. Sultan Mahmud is also said to have killed Tun Mutahir and the Bendahara's family members because Mutahir did not give his daughter, Tun Fatimah's hand in marriage to Sultan Mahmud. Tun Fatimah was married to Tun Ali.