A third external force comes into play with the arrival of the Portuguese in the archipelago.
They reach the rich and expanding Melaka, on the Malay Peninsula, in 1509 and seek trading rights there.
Some in Melaka's cosmopolitan trading community want to accept them (perhaps as a counterweight against Sultan Mahmud's controversial imperial policies), but others do not, heightening existing political tensions.
When the Portuguese return 1511 commanded by the more demanding Alfonso de Albuquerque, they defeat Melaka militarily, soon establishing themselves in the trading ports of Banten (western Java) and Ternate (Maluku), and contacting the much reduced Majapahit kingdom at Kediri in eastern Java.
These events do not, as is sometimes suggested, mark the beginning of Western colonial rule, or even European primacy, in Indonesia; that lies far in the future.
Rather, the "Western intrusion" is at this stage merely one dynamic bound up, in often unpredictable ways, with many others.
Thus, the final days of Majapahit, weakened by internal division, are determined by Trenggana, the half-Chinese Muslim ruler of its former vassal port Demak, who in 1527 conquers Kediri for reasons that had as much to do with economic and political rivalry (with Banten, the Portuguese, and Majapahit's remnants) as they do with religious struggle (with both Christianity and Hindu-Buddhist ideology).