Mahmud Shah of Malacca

Sultan Mahmud Shah ibni Almarhum Sultan Alauddin Riayat Shah (died 1528) ruled the Sultanate of Malacca from 1488 to 1511, and again as pretender to the throne from 1513 to 1528. He was son to Sultan Alauddin Riayat Shah. As a monarch, he was known to be ruthless ruler. After the capture of Malacca and the downfall of the century long sultanate; Mahmud left for Bintan and became a leader of a small confederacy which led attacks against Portuguese-occupied Malacca in the late 1510s. After retaliation from the Portuguese in 1526, he fled to Riau and died there in 1528.

He had several wives, the most notable being Tun Teja. The sultan was surrounded by able men and warriors such as Hang Tuah, Khoja Hassan and Hang Nadim. He had three sons; Ahmad Shah, Muzaffar Shah I and Alauddin Riayat Shah II. Muzaffar and Alauddin Riayat would later form the Perak and Johor Sultanate respectively.

Sultan Mahmud is associated with the Malay legend of Puteri Gunung Ledang which is about his failed courtship of a princess.

Early years and reign
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 the new Bendahara Tun Mutahir. The death of Tun Perak changed Sultan Mahmud into a more responsible ruler, although his rule was turbulent in his twilight years.

It was turbulent since his administration was ineffective and weak, and that Tun Mutahir took bribes and anointed ministers on a whim. This also caused factions amongst the ministers, in which led to Sultan Mahmud executing Tun Mutahir and his entire family due to a certain faction's deception. Sultan Mahmud is also said to have killed Tun Mutahir and the Bendahara's family members because Mutahir did allow Mahmud to marry his daughter, Tun Fatimah. She was later married to Tun Ali. Apart from that, the struggle for power between the ministers ultimately disrupted the unity of the population. The defenses of the sultanate too, deteriorated by the early 16th century due to its army largely consisting of mercenaries who were disloyal to the sultan.

Conflicts with the Portuguese
During the Portuguese admiral Diogo Lopes de Sequeira's visit to Malacca from 1509 to 1510, the sultan planned to assassinate him. However, Sequeira learned of this plot and fled Malacca after losing a few followers to the sultan's guards. 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 Mahmud Shah fled across the Malay Peninsula to Pahang on the east coast, where he made a futile effort to enlist Chinese aid.

Mahmud Shah then moved south and with his capital on the island of Bintan (now part of Indonesia), southeast of Singapore, he continued to receive the tribute and allegiance from surrounding states that had rendered him as ruler of Malacca. He became the leader of a Malay Muslim confederacy and launched several unsuccessful attacks against Portuguese-occupied Malacca between 1515 and 1519. In 1526, the Portuguese responded to the threat of Mahmud Shah's forces by destroying his capital at Bintan. Mahmud Shah finally fled to Kampar, Riau, then died two years later in 1528.

Succession
Ahmad Shah succeeded his father, 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, making him a pretender.

His son Raja Ali, the future Alauddin Riayat Shah II went on to found the Johor Sultanate, which became a major regional sultanate whose power culminated in the 18th and 19th centuries. His other son, Muzaffar was invited by Perak ministers Tun Saban and Nakhoda Kassim to found the Perak Sultanate.