Prior to the arrival of the first Sultan, Malacca was a simple fishing village inhabited by local Malays. Malacca was founded by Parameawara, a Srivijayan prince of Palembang who fled Sumatra following a Majapahit attack in 1377. He found his way to Malacca c. 1400 where he found a good port accessible in all seasons and on the strategically located narrowest point of the Malacca Straits.
According to a popular legend, Parameswara was resting under a gray tree near a river while hunting, when one of his dogs cornered a mouse deer. In self-defence, the mouse deer pushed the dog into the river. Impressed by the courage of the deer, and taking it as a propitious omen of the weak overcoming the powerful, Parameswara decided on the spot to found an empire on the very place that he was sitting.
He named it 'Melaka' after the tree under which he had taken shelter. Another version of the story says that Parameswara chose the name 'Malacca' from the Tamil word 'mallakka' which means upside down or on ones back.