In the Malay epic Sejarah Melayu, Hang Nadim (Jawi: هڠ نديم) Laksamana Hang Nadim was a warrior of the Johor-Riau during the Portuguese occupation of Malacca. He is the son of legendary Malacca Warrior Hang Jebat and foster son another legendary Malacca Warrior Hang Tuah. After the fall of Malacca to the Portuguese in 1511, Sultan Mahmud withdrew from Teloh Naming to Ulu Muar, then settled in Pagoh and Bentayan. Sultan Mahmud and his descendants built up the Johor Sultanate as the basis of Johor-Riau Empire based in Johore, the Riau Islands, Pahang and all those parts of the old Malacca Sultanate which was not occupied by the Portuguese. Although Malacca had fallen to the Portuguese, Sultan Mahmud and his son Sultan Ahmad had continuously sent his army to attack the Portuguese in Malacca from 1511 till 1526. Sultan Mahmud died in Kampar, Sumatra in 1528 and was known as Marhum Kampar. Appointment as Laksamana When Laksamana Khoja Hassan died, Hang Nadim was appointed as the new Laksamana. Hang Nadim assisted Sultan Mahmud in the two attempts he made to recover his throne in 1519 and 1524. In 1516, Hang Nadim attacked Malacca with the hope of recapturing it from the Portuguese, but the attack was unsuccessful. In 1524, Hang Nadim also besieged Malacca in the hope of preventing food reaching the town. The Portuguese were relieved by reinforcements from Goa. Hang Nadim proved his leadership and heroism by defeating the Portuguese when they attacked Bintan and Kopak. His gallantry was highly esteemed by the Malays and the repeated attacks he mounted on the Portuguese weakened their fighting spirit and badly damaged their trade in Malacca. Background In the Sejarah Melayu, the boy who saved Temasek from the swordfishes is not given a name. The name Hang Nadim was only given to the character after later adaptions of the story publicized by popular culture. Hang Nadim is the name of a character in the Sejarah Melayu, however that character appears in a different chapter and is unrelated to the story of the boy who saved Temasek from the swordfishes. It is mentioned in the traditional accounts that the attacks were a curse because the reigning Maharaja had ordered the death of a pious man from Pasei called Tun Jana Khateb. Solution The initial plan of the raja to counter the attacks was to have his men stand in the sea