After the death of Sultan Alauddin Riayat Syah who died in 1488, his son Raja Mahmud was appointed as the eight ruler of Melaka. He was called Sultan Mahmud Syah and was still a youth when he was appointed as the ruler. Hence Melaka was administered by Bendahara Paduka Tun Perak with the help of other senior officials. The senior officials of Melaka were Tun Tahir Seri Nara Diraja as the Chief Treasurer; Tun Mutahir as the Temenggung Seri Maharaja in charge of internal security; Hang Tuah as the Admiral in charge of the fleet of Melaka and Tun Kerutup Seri Bija Diraja as the Commander of the Land Forces.
Bendahara Paduka Tun Perak died in 1498 after having served four Melaka sultans, that is Sultan Muzaffar, Sultan Mansur, Sultan Alauddin and Sultan Mahmud. Sultan Mahmud then appointed Tun Perpatih Putih, brother of the late Bendahara Paduka Raja Tun Perak as the new Bendahara of Melaka and was known as Bendahara Putih.
When Sultan Mahmud grew up, he married his cousin, the daughter of the late Sultan Muhammad Syah, the Sultan of Pahang. They had two daughters and a son by the name of Raja Ahmad. When Bendahara Tun Perpatih Putih died, Sultan Mahmud appointed Tun Mutahir Tememggung Seri Maharaja, his mother?s brother who was the son of Tun Ali.
When Bendahara Tun Perpatih Putih died, Sultan Mahmud appointed Tun Mutahir Temenggung Seri Maharaja, his mother?s brother as the new Bendahara of Melaka with the title Bendahara Seri Maharaja and his son Tun Hasan became the Temenggung with the title Temenggung Tun Hassan.
The town of Melaka began to flourish and prosper with an influx of foreign traders after the appointment of Tun Mutahir. This was due to Bendahara Seri Maharaja?s efficient and wise administration and his ability to attract foreign traders to Melaka.
When Sultan Mahmud?s wife, the princess of Pahang died, he wanted to marry the beautiful princess who was believed to be living on Gunung Ledang (Mount Ophir). The princess stated the conditions required by her for the Sultan to marry her and they were a considerable amount of gold or silver and also a bowl of blood of the prince, Raja Ahmad. However, the Sultan then decided against the idea of marrying the princess. It is difficult to determine whether this story is true or a legend. However, it does exist in stories, which have been handed down by word of mouth by the Malays of Melaka and Johor.
During the reign of Sultan Mahmud Syah, Admiral Hang Tuah died of old age. He was given a state burial and buried in Tanjung Keling, Melaka. The Sultan then appointed Khoja Hasan, the son-in-law of Hang Tuah as the new Admiral of Melaka and was known as Admiral Khoja Hasan.
By about 1500, Melaka was at the height of its power and glory. Its city of Melaka was the capital of a great Malay empire, the chief center of trade in Indian cloth, Chinese porcelain and silk and Malaysian spices, and the headquarters of Muslim activity in the Malay Archipelago.
On 11th September 1509, during Sultan Mahmud?s reign in Melaka and Tun Mutahir was Bendahara, a Portuguese fleet comprising of five big ships led by Diego Lopez de Sequeira, reached the port of Melaka. The arrival of the Portuguese was an ill omen for the country because soon afterwards the decline and fall of the Malay Sultanate begun.