A. Samad Ahmad's version of the Malay Annals identified Sri Tri Buana who reigned in Palembang and the founder of ancient Singapura as the youngest brother of Sang Sapurba, Sri Nila Utama. In A. Samad Ahmad's version, Sang Sapurba was said to have reigned only in Minangkabau. On the other hand, Shellabear and Leyden's versions noted that Sang Nila Utama who reigned in Bintan and later founded ancient Singapura was the son of Sang Sapurba. The "Misa Melayu" and "Silsilah Perak" that contains comprehensive genealogical tree of the Sultans of Perak agreed with Shellabear and Leyden's versions, tracing the lineage of the rulers of Perak directly from Sang Sapurba. If these versions of the Malay Annals and the Perak text are to be taken into account, the line of rulers descended from Sang Sapurba should have begun with Sang Nila Utama who founded the Kingdom of Singapura in 1299. Four generations of rulers reigned over the island kingdom before the last ruler, known in certain accounts as Parameswara, fled after a Majapahit invasion in 1398. In 1400, Parameswara reached the mouth of Bertam river in Malay peninsula, where he established Melaka Sultanate. During the reign of Mansur Shah of Melaka (r. 1459–1477), an heir apparent named Raja Muhammad whose mother was a captured princess of Pahang, was banished for committing murder and went into exile. He was then proclaimed and installed as Sultan of Pahang in 1470. The Portuguese invasion of Melaka in 1511 caused a major split of the royal house when Muzaffar Shah the son of Mahmud Shah of Melaka (r.1488–1511) was invited by the people of Perak to rule the state. Another son, Alauddin Riayat Shah II established the Johor Sultanate to succeed Melaka in 1528.