In Sejarah Melayu, Hang Nadim was a Malay boy of great wisdom who saved Temasek, now called Singapore, from attack by shoals of swordfish, attacks which cost many indigenous Malays their lives. It is mentioned in the traditional accounts that the attack was a curse because the reigning Sri Maharaja had ordered the death of a pious man called Tun Jana Khatib. The name Khatib Camp off Sembawang Road,Singapore is derived from this name. It is said that Khatib Camp is where the execution of Tun Jana Khatib took place.To fend off the attacks, Hang Nadim advised the ruler of Temasek, the Sri Maharaja to build a wall of banana stems along the shores of Temasek. The effort was successful as the swordfishes' snouts were trapped by the barricade of banana stems.
Also well known is Laksamana Hang Nadim, the son of Hang Tuah and a Malay warrior who on several occasions tried to recapture Melaka (Malacca) from the Portuguese.
Laksamana Hang Nadim was a warrior of the Johor-Riau during the Portuguese occupation of Melaka. After the fall of Melaka 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 Melaka Sultanate which was not occupied by the Portuguese. Although Melaka had fallen to the Portuguese, Sultan Mahmud and his son Sultan Ahmad had continuously sent his army to attack the Portuguese in Melaka from 1511 till 1526. Sultan Mahmud died in Kampar, Sumatra in 1528 and was known as Marhum Kampar.
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 Melaka with the hope of recapturing it from the Portuguese, but the attack was unsuccessful. In 1524, Hang Nadim also besieged Melaka 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 Melaka.