 In the 1370s , Singapore was caught in the struggle between Siam ( now Thailand ) and the Java @-@ based Majapahit Empire for control over the Malay Peninsula . According to Sejarah Melayu , Singapore was defeated in one Majapahit attack . The last king , Sultan Iskandar Shah ruled the island for several years , before being forced to Melaka where he founded the Sultanate of Malacca . Singapore became an important trading port of the Malacca Sultanate and later the Sultanate of Johor . 
