Before the arrival of the first Sultan, Malacca was a simple fishing village inhabited by local Malays. Malacca was founded by Parameswara, also called Iskandar Shah or Sri Majara, the last Raja of Singapura (now known as Singapore) following a Majapahit attack in 1377. Parameswara found his way to Malacca in 1400 where he found a port, accessible in all seasons and on the strategically located narrowest point of the Malacca Strait. This later became Malacca.
There are some interesting legends surrounding the foundation and naming of Malacca. According to the 16th century Malay Annals, the city was founded by Parameswara. Some believe it more likely that he was a Hindu prince and political fugitive from nearby Java. The legend goes that Parameswara was out on a hunt in the region and had stopped to refresh himself near what is now the Malacca River. Standing near a melaka (Indian gooseberry) tree he was surprised to witness one of his hunting dogs so startled by a mouse deer that it fell into the river. Parameswara took this as a propitious sign of the weak overcoming the powerful and decided to build the capital of his new kingdom where he stood, naming it for the tree under which he had been resting.