Trowulan
That golden age came under Hayam Wuruk, who reigned from 1350 to 1389 and whose court is celebrated in the Nagarakretagama, a poem of 1365. The poem speaks only of the palace and the temples, but around them spread a crowded city of workshops, markets, canals and brick houses covering some hundred square kilometres. Not all its people were Hindu or Buddhist: Muslims were buried close to the court as early as 1368.
After Hayam Wuruk's death the royal house split into rival courts. Trowulan's western court won the Regreg War of 1405–1406, but the fighting emptied the treasury and loosened Majapahit's hold on the outer islands, while the Muslim ports of Java's north coast grew rich on the spice trade. In 1478 a rival prince's army broke into Trowulan and killed its king in his palace, and in 1527 the Muslim sultanate of Demak swept away what remained of Majapahit.